As the second argument for init_get_bits(buf) can be crafted, a return value check for this function call is necessary. Also replace init_get_bits with init_get_bits8.
Unified · Split
| @@ -167,7 +167,9 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size) · 166 unmodified lines | ||
| 167 | 167 | } |
| 168 | 168 | if (s->use_huffman) { |
| 169 | 169 | s->parse_coeff = vp6_parse_coeff_huffman; |
| 170 | − init_get_bits(&s->gb, buf, buf_size<<3); | |
| 170 | + ret = init_get_bits8(&s->gb, buf, buf_size); | |
| 171 | + if (ret < 0) | |
| 172 | + return ret; | |
| 171 | 173 | } else { |
| 172 | 174 | ret = ff_vp56_init_range_decoder(&s->cc, buf, buf_size); |
| 173 | 175 | if (ret < 0) |