diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-07 15:31:00 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-20 02:45:33 +0100 |
commit | 3e36cba430f787170a382855d190e3e360cace9c (patch) | |
tree | 2cda62040c118380083403eb58f241faf1e6bfd0 | |
parent | d369cc83aa763a780488c9b511507c8624d51c69 (diff) | |
download | ffmpeg-3e36cba430f787170a382855d190e3e360cace9c.tar.gz |
mpeg12: Support decoding dimensions that are a multiple of 4096
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 878e5bd6f555ad6167abacb30d66e47aabcdd745)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mpeg12.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 1e7ff9cf6f..29bee1d779 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1989,8 +1989,6 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, width = get_bits(&s->gb, 12); height = get_bits(&s->gb, 12); - if (width <= 0 || height <= 0) - return -1; s->aspect_ratio_info = get_bits(&s->gb, 4); if (s->aspect_ratio_info == 0) { av_log(avctx, AV_LOG_ERROR, "aspect ratio has forbidden 0 value\n"); @@ -2356,6 +2354,11 @@ static int decode_chunks(AVCodecContext *avctx, break; case PICTURE_START_CODE: + if (s2->width <= 0 || s2->height <= 0) { + av_log(avctx, AV_LOG_ERROR, "%dx%d is invalid\n", s2->width, s2->height); + return AVERROR_INVALIDDATA; + } + if(s->tmpgexs){ s2->intra_dc_precision= 3; s2->intra_matrix[0]= 1; |