summaryrefslogtreecommitdiff
path: root/libavcodec/indeo3.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2012-05-14 19:46:54 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2012-05-15 19:05:39 +0200
commit6de226a2b8b703abc823f18c3fd7f39a0787aeb5 (patch)
treeff29f7b3a244e1854cc3de238931e6a0e8485508 /libavcodec/indeo3.c
parentbc00da27010ed9e5dbe47e5b6fae3dcddb999d78 (diff)
indeo3: validate new frame size before resetting decoder
Diffstat (limited to 'libavcodec/indeo3.c')
-rw-r--r--libavcodec/indeo3.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index e5b2ea7ef0..d526d910da 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -900,6 +900,14 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
av_dlog(avctx, "Frame dimensions changed!\n");
+ if (width < 16 || width > 640 ||
+ height < 16 || height > 480 ||
+ width & 3 || height & 3) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid picture dimensions: %d x %d!\n", width, height);
+ return AVERROR_INVALIDDATA;
+ }
+
ctx->width = width;
ctx->height = height;