Skip to content
Snippets Groups Projects
Commit 0a8bff78 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Vittorio Giovara
Browse files

dds: disable palette flag for compressed images


Having both is not valid and can cause a NULL pointer dereference of
frame->data[1] later.

Signed-off-by: default avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: default avatarVittorio Giovara <vittorio.giovara@gmail.com>
parent 2fb6e1e7
No related branches found
No related tags found
No related merge requests found
...@@ -141,6 +141,12 @@ static int parse_pixel_format(AVCodecContext *avctx) ...@@ -141,6 +141,12 @@ static int parse_pixel_format(AVCodecContext *avctx)
normal_map = flags & DDPF_NORMALMAP; normal_map = flags & DDPF_NORMALMAP;
fourcc = bytestream2_get_le32(gbc); 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 bpp = bytestream2_get_le32(gbc); // rgbbitcount
r = bytestream2_get_le32(gbc); // rbitmask r = bytestream2_get_le32(gbc); // rbitmask
g = bytestream2_get_le32(gbc); // gbitmask g = bytestream2_get_le32(gbc); // gbitmask
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment