History

avcodec/qdrw: Fix null pointer dereference

The RGB555 PACKBITSRGN case tries to read a palette, if such palette is actually stored then it accesses a null pointer. All 16bit samples i could find use DIRECTBITSRGN. Fixes: 2065/clusterfuzz-testcase-minimized-6298930457346048

Michael Niedermayer committed 9 years ago

Commit 46b865e1 parent b315a3c1 file · +5 −1Browse files

Unified · Split

libavcodec/qdrw.c+5−1
@@ -58,6 +58,8 @@ static int parse_palette(AVCodecContext *avctx, GetByteContext *gbc, · 57 unmodified lines
58 bytestream2_skip(gbc, 6);58 bytestream2_skip(gbc, 6);
59 continue;59 continue;
60 }60 }
61 if (avctx->pix_fmt != AV_PIX_FMT_PAL8)
62 return AVERROR_INVALIDDATA;
61 r = bytestream2_get_byte(gbc);63 r = bytestream2_get_byte(gbc);
62 bytestream2_skip(gbc, 1);64 bytestream2_skip(gbc, 1);
63 g = bytestream2_get_byte(gbc);65 g = bytestream2_get_byte(gbc);
@@ -378,7 +380,9 @@ static int decode_frame(AVCodecContext *avctx, · 314 unmodified lines
378 if ((ret = ff_get_buffer(avctx, p, 0)) < 0)380 if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
379 return ret;381 return ret;
380 382
381 parse_palette(avctx, &gbc, (uint32_t *)p->data[1], colors);383 ret = parse_palette(avctx, &gbc, (uint32_t *)p->data[1], colors);
384 if (ret < 0)
385 return ret;
382 p->palette_has_changed = 1;386 p->palette_has_changed = 1;
383 387
384 /* jump to image data */388 /* jump to image data */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t