Browse Source

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>
tags/n3.0
Andreas Cadhalpun 9 years ago
parent
commit
603ebab8d7
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/dds.c

+ 6
- 0
libavcodec/dds.c View File

@@ -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


Loading…
Cancel
Save