[FFmpeg-cvslog] xan: Prevent NULL dereference with missing palette

Laurent Aimar git at videolan.org
Mon Mar 19 05:30:29 CET 2012


ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Thu Sep 29 03:12:07 2011 +0000| [be2404b06d7cddc8152337e51ae2ca97b6536eea] | committer: Reinhard Tartler

xan: Prevent NULL dereference with missing palette

Signed-off-by: Janne Grunau <janne-libav at jannau.net>
(cherry picked from commit 7d17a794f0348ba40d5cda7d969564cb83981001)

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavcodec/xan.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 2b3a409..d57a4fb 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -553,6 +553,11 @@ static int xan_decode_frame(AVCodecContext *avctx,
         }
         buf_size = buf_end - buf;
     }
+    if (s->palettes_count <= 0) {
+        av_log(s->avctx, AV_LOG_ERROR, "No palette found\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if ((ret = avctx->get_buffer(avctx, &s->current_frame))) {
         av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return ret;



More information about the ffmpeg-cvslog mailing list