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
15int vp8dx_start_decode(BOOL_DECODER *br, const unsigned char *source,15int vp8dx_start_decode(BOOL_DECODER *br, const unsigned char *source,
16 unsigned int source_sz, vpx_decrypt_cb decrypt_cb,16 unsigned int source_sz, vpx_decrypt_cb decrypt_cb,
17 void *decrypt_state) {17 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;
19 br->user_buffer = source;23 br->user_buffer = source;
20 br->value = 0;24 br->value = 0;
21 br->count = -8;25 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