aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-15 22:11:05 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-17 23:18:48 +0100
commit598016b85f29d793922c3289d50cab2393582443 (patch)
tree30891ad410a9cdd0e1fa333cb813b3cbd0f2313d
parenta2c7840a6b69671adec490cac375f51e09a654b4 (diff)
downloadffmpeg-598016b85f29d793922c3289d50cab2393582443.tar.gz
dds: limit 4 bpp handling to AV_PIX_FMT_PAL8
This fixes NULL pointer dereferencing for formats, where frame->data[1] is not allocated. The problem was introduced in commit 257fbc3af4cba08ac471dab68924182160bde6fd. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 90ebf3c428352eb1d4116bf97b470ceca295d7d6) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavcodec/dds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dds.c b/libavcodec/dds.c
index 43319a8441..fa0f34d7e7 100644
--- a/libavcodec/dds.c
+++ b/libavcodec/dds.c
@@ -680,7 +680,7 @@ static int dds_decode(AVCodecContext *avctx, void *data,
/* Use the decompress function on the texture, one block per thread. */
ctx->tex_data = gbc->buffer;
avctx->execute2(avctx, decompress_texture_thread, frame, NULL, ctx->slice_count);
- } else if (!ctx->paletted && ctx->bpp == 4) {
+ } else if (!ctx->paletted && ctx->bpp == 4 && avctx->pix_fmt == AV_PIX_FMT_PAL8) {
uint8_t *dst = frame->data[0];
int x, y, i;