[FFmpeg-cvslog] yop: check for missing extradata

Michael Niedermayer git at videolan.org
Sat Jun 9 21:39:18 CEST 2012


ffmpeg | branch: release/0.6 | Michael Niedermayer <michaelni at gmx.at> | Mon May 28 17:08:06 2012 +0200| [62cbdd71eb2c0051cc5a9797db5ea82399337344] | committer: Michael Niedermayer

yop: check for missing extradata

Fixes null ptr deref
Fixes Ticket1361

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 77a4c8b959fa9bc6bcaa42b40a0b046cdf3fec38)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/yop.c b/libavcodec/yop.c
index 1eb76b1..1adbd61 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) {
+        av_log(avctx, AV_LOG_ERROR, "extradata missing\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     avctx->pix_fmt = PIX_FMT_PAL8;
 
     s->num_pal_colors = avctx->extradata[0];



More information about the ffmpeg-cvslog mailing list