mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 14:17:45 +00:00
Fix possible crash in corrupt media files.
This commit is contained in:
@@ -149,7 +149,7 @@ Stream File::Context::initStream(
|
|||||||
result.duration = (info->duration != AV_NOPTS_VALUE)
|
result.duration = (info->duration != AV_NOPTS_VALUE)
|
||||||
? PtsToTime(info->duration, result.timeBase)
|
? PtsToTime(info->duration, result.timeBase)
|
||||||
: PtsToTime(format->duration, kUniversalTimeBase);
|
: PtsToTime(format->duration, kUniversalTimeBase);
|
||||||
if (!result.duration) {
|
if (result.duration <= 0) {
|
||||||
result.codec = nullptr;
|
result.codec = nullptr;
|
||||||
} else if (result.duration == kTimeUnknown) {
|
} else if (result.duration == kTimeUnknown) {
|
||||||
result.duration = kDurationUnavailable;
|
result.duration = kDurationUnavailable;
|
||||||
|
Reference in New Issue
Block a user