Browse Source

h264: fix integer overflow, assert failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 12 years ago
parent
commit
2d5f1addbe
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      libavcodec/h264.c

+ 6
- 2
libavcodec/h264.c View File

@@ -1104,8 +1104,12 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
h->x264_build = -1; h->x264_build = -1;
ff_h264_reset_sei(h); ff_h264_reset_sei(h);
if (avctx->codec_id == AV_CODEC_ID_H264) { if (avctx->codec_id == AV_CODEC_ID_H264) {
if (avctx->ticks_per_frame == 1)
s->avctx->time_base.den *= 2;
if (avctx->ticks_per_frame == 1) {
if(s->avctx->time_base.den < INT_MAX/2) {
s->avctx->time_base.den *= 2;
} else
s->avctx->time_base.num /= 2;
}
avctx->ticks_per_frame = 2; avctx->ticks_per_frame = 2;
} }




Loading…
Cancel
Save