diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-07 19:53:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-07 19:59:00 +0200 |
commit | 50ec8a2acd4f7ad422c0883153b856e737adf973 (patch) | |
tree | b81120c115381db798474e15b054185181999a87 /libavcodec/mpeg4videodec.c | |
parent | 59edf33f7bfd3b50ca7f7ad95d8aad5c32c7f1af (diff) | |
download | ffmpeg-streaming-50ec8a2acd4f7ad422c0883153b856e737adf973.zip ffmpeg-streaming-50ec8a2acd4f7ad422c0883153b856e737adf973.tar.gz |
mpeg4videodec: Force quant_precision to stay within the valid range.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpeg4videodec.c')
-rw-r--r-- | libavcodec/mpeg4videodec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 99aecbb..43e9d32 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -1674,6 +1674,9 @@ static int decode_vol_header(MpegEncContext *s, GetBitContext *gb){ s->quant_precision = get_bits(gb, 4); /* quant_precision */ if(get_bits(gb, 4)!=8) av_log(s->avctx, AV_LOG_ERROR, "N-bit not supported\n"); /* bits_per_pixel */ if(s->quant_precision!=5) av_log(s->avctx, AV_LOG_ERROR, "quant precision %d\n", s->quant_precision); + if(s->quant_precision<3 || s->quant_precision>9) { + s->quant_precision = 5; + } } else { s->quant_precision = 5; } |