summaryrefslogtreecommitdiff
path: root/libavcodec/xan.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-29 01:04:51 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-29 06:11:18 +0200
commit56ee5a9ad1b385129c40ba4773f99bc5943ae8af (patch)
tree9a8480726e42d65f773b104a5b0743019c76b348 /libavcodec/xan.c
parent5279141c1d7a72c467b7e0666fc2275cbcec4668 (diff)
Prevent NULL dereference when the palette is missing in the xan decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/xan.c')
-rw-r--r--libavcodec/xan.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 51b4b958b2..fe11ac3f7a 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;