aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-17 02:08:10 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-17 02:20:20 +0100
commitc961ce969a613e08c720cb6aa3cce4bd81cefe3f (patch)
tree2ec5c1ed47aae83f32f455c08a7d947c659498c0 /libavformat/utils.c
parent52cea9ce9209bf4ee0af6475b7db880e962cb924 (diff)
parenta335ffd7f4cdaaa6a8fe4187f6f06b0418eea19a (diff)
downloadffmpeg-c961ce969a613e08c720cb6aa3cce4bd81cefe3f.tar.gz
Merge commit 'a335ffd7f4cdaaa6a8fe4187f6f06b0418eea19a' into release/0.10
* commit 'a335ffd7f4cdaaa6a8fe4187f6f06b0418eea19a': h264: fix sps parsing for SVC and CAVLC 4:4:4 Intra profiles h264: check sps.log2_max_frame_num for validity h264: slice-mt: get last_pic_dropable from master context ppc: always use pic for shared libraries h264: error out on unset current_picture_ptr for h->current_slice > 0 flashsv: make sure data for zlib priming is available h264: enable low delay only if no delayed frames were seen flashsv: check for keyframe before using differential coding lavf: avoid integer overflow in ff_compute_frame_duration() aacdec: Fix an off-by-one overwrite when switching to LTP profile from MAIN. APIchanges: Fill in missing commit hashes Conflicts: doc/APIchanges Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 25673a63c8..7e807c2333 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -902,7 +902,10 @@ static void 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.