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

Laurent Aimar git at videolan.org
Sat Oct 8 03:47:31 CEST 2011


ffmpeg | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Sep 29 03:12:07 2011 +0000| [7d17a794f0348ba40d5cda7d969564cb83981001] | committer: Janne Grunau

xan: Prevent NULL dereference with missing palette

Signed-off-by: Janne Grunau <janne-libav at jannau.net>

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

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

diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 3965617..54d6d15 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