History

vp8 boolreader: ignore invalid input

Do basic initialization even when the result will not be used. BUG=chromium:1026961

Johann committed 6 years ago

Commit 80e56661 parent 89375f01 file · +5 −1Browse files

Unified · Split

vp8/decoder/dboolhuff.c+5−1
@@ -15,7 +15,11 @@ · 14 unmodified lines
1515 int vp8dx_start_decode(BOOL_DECODER *br, const unsigned char *source,
1616 unsigned int source_sz, vpx_decrypt_cb decrypt_cb,
1717 void *decrypt_state) {
18− br->user_buffer_end = source + source_sz;
18+ // To simplify calling code this fuction can be called with |source| == null
19+ // and |source_sz| == 0. This and vp8dx_bool_decoder_fill() are essentially
20+ // no-ops in this case.
21+ // Work around a ubsan warning with a ternary to avoid adding 0 to null.
22+ br->user_buffer_end = source ? source + source_sz : source;
1923 br->user_buffer = source;
2024 br->value = 0;
2125 br->count = -8;

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