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
5858 bytestream2_skip(gbc, 6);
5959 continue;
6060 }
61+ if (avctx->pix_fmt != AV_PIX_FMT_PAL8)
62+ return AVERROR_INVALIDDATA;
6163 r = bytestream2_get_byte(gbc);
6264 bytestream2_skip(gbc, 1);
6365 g = bytestream2_get_byte(gbc);
@@ -378,7 +380,9 @@ static int decode_frame(AVCodecContext *avctx, · 314 unmodified lines
378380 if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
379381 return ret;
380382
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;
382386 p->palette_has_changed = 1;
383387
384388 /* 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