[FFmpeg-cvslog] yop: check that extradata is large enough.

Anton Khirnov git at videolan.org
Thu Feb 14 13:01:39 CET 2013


ffmpeg | branch: release/1.1 | Anton Khirnov <anton at khirnov.net> | Wed Jan 30 07:00:50 2013 +0100| [7e35c50b81d97b513f6c4c719f2d476a681bd6d7] | committer: Reinhard Tartler

yop: check that extradata is large enough.

CC:libav-stable at libav.org
(cherry picked from commit 06cf597c352519d2b70f293518c61b8c312f5d4f)

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

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

 libavcodec/yop.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/yop.c b/libavcodec/yop.c
index 0b9cdfe..939b81c 100644
--- a/libavcodec/yop.c
+++ b/libavcodec/yop.c
@@ -89,6 +89,11 @@ static av_cold int yop_decode_init(AVCodecContext *avctx)
         return -1;
     }
 
+    if (avctx->extradata_size < 3) {
+        av_log(avctx, AV_LOG_ERROR, "Missing or incomplete extradata.\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
 
     s->num_pal_colors = avctx->extradata[0];



More information about the ffmpeg-cvslog mailing list