xan: Prevent NULL dereference with missing palette
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 7d17a794f0
)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:

committed by
Reinhard Tartler

parent
49007b494e
commit
be2404b06d
@@ -553,6 +553,11 @@ static int xan_decode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
buf_size = buf_end - buf;
|
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))) {
|
if ((ret = avctx->get_buffer(avctx, &s->current_frame))) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user