diff options
author | Peter Ross <pross@xvid.org> | 2012-10-14 22:11:42 +1100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-14 16:01:22 +0200 |
commit | 6bf43441f0a77ed7a4ed0e40ef732ec11cedf73d (patch) | |
tree | 374bf5d53c506d8bff9b5d028d0ddd40ece13bf0 | |
parent | 0ea55365b91c250012ac8a80be5f0ebacd4fd55d (diff) | |
download | ffmpeg-6bf43441f0a77ed7a4ed0e40ef732ec11cedf73d.tar.gz |
eatgq: raise error on unsupported macroblock mode
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/eatgq.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index 4de5c066f2..f8d90101b7 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -141,7 +141,10 @@ static void tgq_idct_put_mb_dconly(TgqContext *s, int mb_x, int mb_y, const int8 } } -static void tgq_decode_mb(TgqContext *s, int mb_y, int mb_x){ +/** + * @return <0 on error + */ +static int tgq_decode_mb(TgqContext *s, int mb_y, int mb_x){ int mode; int i; int8_t dc[6]; @@ -168,9 +171,11 @@ static void tgq_decode_mb(TgqContext *s, int mb_y, int mb_x){ } }else{ av_log(s->avctx, AV_LOG_ERROR, "unsupported mb mode %i\n", mode); + return -1; } tgq_idct_put_mb_dconly(s, mb_x, mb_y, dc); } + return 0; } static void tgq_calculate_qtable(TgqContext *s, int quant){ @@ -225,7 +230,8 @@ static int tgq_decode_frame(AVCodecContext *avctx, for (y = 0; y < FFALIGN(avctx->height, 16) >> 4; y++) for (x = 0; x < FFALIGN(avctx->width, 16) >> 4; x++) - tgq_decode_mb(s, y, x); + if (tgq_decode_mb(s, y, x) < 0) + return AVERROR_INVALIDDATA; *data_size = sizeof(AVFrame); *(AVFrame*)data = s->frame; |