History

better hdr_valid() check, fixes out-of-bounds table access found by afl

lieff committed 8 years ago

Commit 0da45b11 parent 91080871 file · +1 −0Browse files

Unified · Split

minimp3.h+1−0
@@ -266,6 +266,7 @@ static int hdr_valid(const uint8_t *h) · 265 unmodified lines
266{266{
267 return h[0] == 0xff &&267 return h[0] == 0xff &&
268 ((h[1] & 0xF0) == 0xf0 || (h[1] & 0xFE) == 0xe2) &&268 ((h[1] & 0xF0) == 0xf0 || (h[1] & 0xFE) == 0xe2) &&
269 (HDR_GET_LAYER(h) != 0) &&
269 (HDR_GET_BITRATE(h) != 15) &&270 (HDR_GET_BITRATE(h) != 15) &&
270 (HDR_GET_SAMPLE_RATE(h) != 3);271 (HDR_GET_SAMPLE_RATE(h) != 3);
271}272}

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