[FFmpeg-cvslog] Prevent NULL dereference when the palette is missing in the xan decoder.

Laurent Aimar git at videolan.org
Sat Oct 1 21:38:56 CEST 2011


ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Thu Sep 29 01:04:51 2011 +0200| [14617fa7b8e688f5688d3679c906c8cb75ff42ed] | committer: Michael Niedermayer

Prevent NULL dereference when the palette is missing in the xan decoder.

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

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

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

diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 52f3a3f..b903539 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -552,6 +552,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;



More information about the ffmpeg-cvslog mailing list