mirror of https://git.ffmpeg.org/ffmpeg.git
utils/update_stream_timings: fix division by zero
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
108957c661
commit
41dba453f9
|
@ -2101,7 +2101,7 @@ static void update_stream_timings(AVFormatContext *ic)
|
||||||
if (end_time != INT64_MIN)
|
if (end_time != INT64_MIN)
|
||||||
duration = FFMAX(duration, end_time - start_time);
|
duration = FFMAX(duration, end_time - start_time);
|
||||||
}
|
}
|
||||||
if (duration != INT64_MIN && ic->duration == AV_NOPTS_VALUE) {
|
if (duration != INT64_MIN && duration > 0 && ic->duration == AV_NOPTS_VALUE) {
|
||||||
ic->duration = duration;
|
ic->duration = duration;
|
||||||
}
|
}
|
||||||
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration != AV_NOPTS_VALUE) {
|
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration != AV_NOPTS_VALUE) {
|
||||||
|
|
Loading…
Reference in New Issue