[FFmpeg-devel] [PATCH 3/6] Prevent NULL dereference when the palette is missing in the xan decoder.

fenrir at elivagar.org fenrir at elivagar.org
Thu Sep 29 01:04:51 CEST 2011


From: Laurent Aimar <fenrir at videolan.org>

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

diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 3359102..1f0fab6 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -555,6 +555,9 @@ static int xan_decode_frame(AVCodecContext *avctx,
         }
         buf_size = buf_end - buf;
     }
+    if (s->palettes_count <= 0)
+        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;
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list