Prevent overflow of start_time + recording_time.

Patch by Francesco Cosoleto gmail($name)

Originally committed as revision 22077 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Francesco Cosoleto 2010-02-26 14:46:20 +00:00 committed by Benoit Fouet
parent be707647e9
commit 6abda15f56
1 changed files with 2 additions and 1 deletions

View File

@ -2305,7 +2305,8 @@ static int av_encode(AVFormatContext **output_files,
} }
/* finish if recording time exhausted */ /* finish if recording time exhausted */
if (av_compare_ts(pkt.pts, ist->st->time_base, recording_time + start_time, (AVRational){1, 1000000}) >= 0) { if (recording_time != INT64_MAX &&
av_compare_ts(pkt.pts, ist->st->time_base, recording_time + start_time, (AVRational){1, 1000000}) >= 0) {
ist->is_past_recording_time = 1; ist->is_past_recording_time = 1;
goto discard_packet; goto discard_packet;
} }