diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-11-13 21:48:27 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-11-14 21:52:11 +0100 |
commit | 603ebab8d7b789cd3cb6c7ca645a7badb5b950b4 (patch) | |
tree | 4f2674872e179dae0a5d9bf3abb0055875082672 /libavcodec/dds.c | |
parent | ebf5264cd6bbda6c0c379dfeaaba3b9afc3279a8 (diff) | |
download | ffmpeg-603ebab8d7b789cd3cb6c7ca645a7badb5b950b4.tar.gz |
dds: disable palette flag for compressed dds
Having both is not valid and can cause a NULL pointer dereference of
frame->data[1] later.
Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/dds.c')
-rw-r--r-- | libavcodec/dds.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/dds.c b/libavcodec/dds.c index f04a4f5a6e..d473fd14cf 100644 --- a/libavcodec/dds.c +++ b/libavcodec/dds.c @@ -141,6 +141,12 @@ static int parse_pixel_format(AVCodecContext *avctx) normal_map = flags & DDPF_NORMALMAP; fourcc = bytestream2_get_le32(gbc); + if (ctx->compressed && ctx->paletted) { + av_log(avctx, AV_LOG_WARNING, + "Disabling invalid palette flag for compressed dds.\n"); + ctx->paletted = 0; + } + bpp = bytestream2_get_le32(gbc); // rgbbitcount r = bytestream2_get_le32(gbc); // rbitmask g = bytestream2_get_le32(gbc); // gbitmask |