Browse Source

utils/update_stream_timings: fix division by zero

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.0
Michael Niedermayer 13 years ago
parent
commit
41dba453f9
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/utils.c

+ 1
- 1
libavformat/utils.c View File

@@ -2101,7 +2101,7 @@ static void update_stream_timings(AVFormatContext *ic)
if (end_time != INT64_MIN)
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;
}
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration != AV_NOPTS_VALUE) {


Loading…
Cancel
Save