comparison vp6.c @ 9920:8332746a9db9 libavcodec

Add a check to vp6_parse_coeff_huffman to ensure it does not overread the input buffer.
author reimar
date Sun, 05 Jul 2009 16:01:51 +0000
parents 0dce4fe6e6f3
children 8d23ea397dda
comparison
equal deleted inserted replaced
9919:c7c1c6b35a73 9920:8332746a9db9
370 if (coeff_idx<2 && s->nb_null[coeff_idx][pt]) { 370 if (coeff_idx<2 && s->nb_null[coeff_idx][pt]) {
371 s->nb_null[coeff_idx][pt]--; 371 s->nb_null[coeff_idx][pt]--;
372 if (coeff_idx) 372 if (coeff_idx)
373 break; 373 break;
374 } else { 374 } else {
375 if (get_bits_count(&s->gb) >= s->gb.size_in_bits)
376 return;
375 coeff = get_vlc2(&s->gb, vlc_coeff->table, 9, 3); 377 coeff = get_vlc2(&s->gb, vlc_coeff->table, 9, 3);
376 if (coeff == 0) { 378 if (coeff == 0) {
377 if (coeff_idx) { 379 if (coeff_idx) {
378 int pt = (coeff_idx >= 6); 380 int pt = (coeff_idx >= 6);
379 run += get_vlc2(&s->gb, s->runv_vlc[pt].table, 9, 3); 381 run += get_vlc2(&s->gb, s->runv_vlc[pt].table, 9, 3);