History

avcodec/msp2dec: Check available space in RLE decoder

Fixes: out of array read Fixes: 32968/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSP2_fuzzer-5315296027082752

Michael Niedermayer committed 5 years ago

Commit caaf4631 parent 44c8b671 file · +1 −0Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/msp2dec.c+1−0
@@ -71,6 +71,7 @@ static int msp2_decode_frame(AVCodecContext *avctx, · 70 unmodified lines
71 while (bytestream2_get_bytes_left(&gb) && x < width) {71 while (bytestream2_get_bytes_left(&gb) && x < width) {
72 int size = bytestream2_get_byte(&gb);72 int size = bytestream2_get_byte(&gb);
73 if (size) {73 if (size) {
74 size = FFMIN(size, bytestream2_get_bytes_left(&gb));
74 memcpy(p->data[0] + y * p->linesize[0] + x, gb.buffer, FFMIN(size, width - x));75 memcpy(p->data[0] + y * p->linesize[0] + x, gb.buffer, FFMIN(size, width - x));
75 bytestream2_skip(&gb, size);76 bytestream2_skip(&gb, size);
76 } else {77 } else {

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