Skip to content

Commit 7a18ea3

Browse files
committed
Check that this S3 stream is 'seekable' first
Signed-off-by: invario <[email protected]>
1 parent 42ca705 commit 7a18ea3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/private/Preview/Movie.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,16 @@ public function isAvailable(FileInfo $file): bool {
4343
}
4444

4545
private function connectDirect(File $file): string|false {
46+
if (stream_get_meta_data($file->fopen('r'))['seekable']!== true) {
47+
return false;
48+
}
49+
4650
// Checks for availability to access the video file directly via HTTP/HTTPS.
4751
// Returns a string containing URL if available. Only implemented and tested
4852
// with Amazon S3 currently. In all other cases, return false. ffmpeg
4953
// supports other protocols so this function may expand in the future.
5054
$gddValues = $file->getStorage()->getDirectDownload($file->getName());
55+
5156
if (is_array($gddValues)) {
5257
if (array_key_exists('url', $gddValues) && array_key_exists('presigned', $gddValues)) {
5358
$directUrl = (str_starts_with($gddValues['url'], 'http') && ($gddValues['presigned'] === true)) ? $gddValues['url'] : false;

0 commit comments

Comments
 (0)