comparison flacdec.c @ 9105:9ae9d486669a libavcodec

flacdec: Return error when blocksize code of 0 is found. It is a reserved value per the FLAC format documentation.
author jbr
date Tue, 03 Mar 2009 05:22:44 +0000
parents 03a05f3afbae
children 4984f305def8
comparison
equal deleted inserted replaced
9104:fd301ba2cbba 9105:9ae9d486669a
525 if (get_utf8(&s->gb) < 0) { 525 if (get_utf8(&s->gb) < 0) {
526 av_log(s->avctx, AV_LOG_ERROR, "utf8 fscked\n"); 526 av_log(s->avctx, AV_LOG_ERROR, "utf8 fscked\n");
527 return -1; 527 return -1;
528 } 528 }
529 529
530 if (blocksize_code == 0) 530 if (blocksize_code == 0) {
531 blocksize = s->min_blocksize; 531 av_log(s->avctx, AV_LOG_ERROR, "reserved blocksize code: 0\n");
532 else if (blocksize_code == 6) 532 return -1;
533 } else if (blocksize_code == 6)
533 blocksize = get_bits(&s->gb, 8)+1; 534 blocksize = get_bits(&s->gb, 8)+1;
534 else if (blocksize_code == 7) 535 else if (blocksize_code == 7)
535 blocksize = get_bits(&s->gb, 16)+1; 536 blocksize = get_bits(&s->gb, 16)+1;
536 else 537 else
537 blocksize = blocksize_table[blocksize_code]; 538 blocksize = blocksize_table[blocksize_code];