You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
avformat/utils: reorder operations in update_wrap_reference()
prevents a integer overflow Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@ -887,12 +887,11 @@ static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_in
|
|||||||
|
|
||||||
if (ref == AV_NOPTS_VALUE)
|
if (ref == AV_NOPTS_VALUE)
|
||||||
ref = pkt->pts;
|
ref = pkt->pts;
|
||||||
if (ref == AV_NOPTS_VALUE)
|
if (st->pts_wrap_reference != AV_NOPTS_VALUE || st->pts_wrap_bits >= 63 || ref == AV_NOPTS_VALUE || !s->correct_ts_overflow)
|
||||||
return 0;
|
return 0;
|
||||||
ref &= (1LL<<st->pts_wrap_bits)-1;
|
ref &= (1LL<<st->pts_wrap_bits)-1;
|
||||||
|
|
||||||
if (s->correct_ts_overflow && st->pts_wrap_bits < 63 &&
|
{
|
||||||
st->pts_wrap_reference == AV_NOPTS_VALUE) {
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// reference time stamp should be 60 s before first time stamp
|
// reference time stamp should be 60 s before first time stamp
|
||||||
@ -945,7 +944,6 @@ static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_in
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void update_initial_timestamps(AVFormatContext *s, int stream_index,
|
static void update_initial_timestamps(AVFormatContext *s, int stream_index,
|
||||||
|
Reference in New Issue
Block a user