Skip to content

Commit 1e67857

Browse files
blizzzbackportbot[bot]
authored andcommitted
fix: unbloc ffmpeg on some broken videos
Co-authored-by: Joas Schilling <[email protected]> Signed-off-by: Arthur Schiwon <[email protected]> [skip ci]
1 parent 5cddf5a commit 1e67857

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

.reuse/dep5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Files: tests/data/integritycheck/htaccessWithValidModifiedContent/.htaccess
107107
Copyright: 2016 ownCloud, Inc., 2019 Nextcloud GmbH and Nextcloud contributors
108108
License: AGPL-3.0-only
109109

110-
Files: core/img/favicon*.* core/img/logo/logo*.* tests/data/testimage.webp apps/testing/img/logo.png core/img/apps/spreed.svg
110+
Files: core/img/favicon*.* core/img/logo/logo*.* tests/data/testimage.webp tests/data/broken-video.webm apps/testing/img/logo.png core/img/apps/spreed.svg
111111
Copyright: 2016-2024 Nextcloud GmbH
112112
License: LicenseRef-NextcloudTrademarks
113113

lib/private/Preview/Movie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ private function generateThumbNail(int $maxX, int $maxY, string $absPath, int $s
135135
$returnCode = -1;
136136
$output = '';
137137
if (is_resource($proc)) {
138-
$stdout = trim(stream_get_contents($pipes[1]));
139138
$stderr = trim(stream_get_contents($pipes[2]));
139+
$stdout = trim(stream_get_contents($pipes[1]));
140140
$returnCode = proc_close($proc);
141141
$output = $stdout . $stderr;
142142
}

tests/data/broken-video.webm

1.63 MB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
6+
* SPDX-License-Identifier: AGPL-3.0-or-later
7+
*/
8+
9+
namespace Test\Preview;
10+
11+
/**
12+
* Class MovieTest
13+
*
14+
* @group DB
15+
*
16+
* @package Test\Preview
17+
*/
18+
class MovieBrokenStuckFfmpegTest extends MovieTest {
19+
protected string $fileName = 'broken-video.webm';
20+
}

tests/lib/Preview/MovieTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
* @package Test\Preview
1616
*/
1717
class MovieTest extends Provider {
18+
protected string $fileName = 'testimage.mp4';
19+
protected int $width = 560;
20+
protected int $height = 320;
21+
1822
protected function setUp(): void {
1923
$avconvBinary = \OC_Helper::findBinaryPath('avconv');
2024
$ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg');

0 commit comments

Comments
 (0)