Browse Source

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  lavf: avoid integer overflow in ff_compute_frame_duration()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
386fc67c79
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavformat/utils.c

+ 4
- 1
libavformat/utils.c View File

@@ -826,7 +826,10 @@ void ff_compute_frame_duration(int *pnum, int *pden, AVStream *st,
*pnum = st->codec->time_base.num;
*pden = st->codec->time_base.den;
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
//Thus if we have no parser in such case leave duration undefined.


Loading…
Cancel
Save