Commit 386fc67c authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  lavf: avoid integer overflow in ff_compute_frame_duration()
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents a3f30f2e 7709ce02
...@@ -826,7 +826,10 @@ void ff_compute_frame_duration(int *pnum, int *pden, AVStream *st, ...@@ -826,7 +826,10 @@ void ff_compute_frame_duration(int *pnum, int *pden, AVStream *st,
*pnum = st->codec->time_base.num; *pnum = st->codec->time_base.num;
*pden = st->codec->time_base.den; *pden = st->codec->time_base.den;
if (pc && pc->repeat_pict) { if (pc && pc->repeat_pict) {
*pnum = (*pnum) * (1 + pc->repeat_pict); if (*pnum > INT_MAX / (1 + pc->repeat_pict))
*pden /= 1 + pc->repeat_pict;
else
*pnum *= 1 + pc->repeat_pict;
} }
//If this codec can be interlaced or progressive then we need a parser to compute duration of a packet //If this codec can be interlaced or progressive then we need a parser to compute duration of a packet
//Thus if we have no parser in such case leave duration undefined. //Thus if we have no parser in such case leave duration undefined.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment