Otherwise it causes a NULL pointer dereference of frame->data[1]. Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> --- libavcodec/dds.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/libavcodec/dds.c b/libavcodec/dds.c index c918cf0..fe36709 100644 --- a/libavcodec/dds.c +++ b/libavcodec/dds.c @@ -662,6 +662,11 @@ static int dds_decode(AVCodecContext *avctx, void *data, if (ctx->paletted) { int i; + if (!frame->data[1]) { + av_log(avctx, AV_LOG_ERROR, + "Palette frame buffer is not allocated.\n"); + return AVERROR_INVALIDDATA; + } /* Use the first 1024 bytes as palette, then copy the rest. */ bytestream2_get_buffer(gbc, frame->data[1], 256 * 4); for (i = 0; i < 256; i++) -- 2.6.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel