[FFmpeg-cvslog] indeo3: validate new frame size before resetting decoder

Kostya Shishkov git at videolan.org
Tue Oct 16 16:36:07 CEST 2012


ffmpeg | branch: release/0.10 | Kostya Shishkov <kostya.shishkov at gmail.com> | Mon May 14 19:46:54 2012 +0200| [d4f3abca6a76f322d0b8c5e90dd0368efdf58821] | committer: Anton Khirnov

indeo3: validate new frame size before resetting decoder

(cherry picked from commit 6de226a2b8b703abc823f18c3fd7f39a0787aeb5)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d4f3abca6a76f322d0b8c5e90dd0368efdf58821
---

 libavcodec/indeo3.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index 55b4ec7..b7ef9e5 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -895,6 +895,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;
 



More information about the ffmpeg-cvslog mailing list