mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
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: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
(cherry picked from commit 0a8bff788b
)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
ef699b4135
commit
bf2f7115d9
@ -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…
Reference in New Issue
Block a user