comparison wavpack.c @ 9592:05661d19f6d2 libavcodec

Check whether extra bits block has enough data. Patch by Laurent Aimar "f\145nr\151r >at< vide\157lan <dot> o\162g"
author kostya
date Sun, 03 May 2009 05:42:51 +0000
parents 2a52dd5a684a
children b60289b3e29a
comparison
equal deleted inserted replaced
9591:483ba97736f8 9592:05661d19f6d2
793 } 793 }
794 if(!got_bs){ 794 if(!got_bs){
795 av_log(avctx, AV_LOG_ERROR, "Packed samples not found\n"); 795 av_log(avctx, AV_LOG_ERROR, "Packed samples not found\n");
796 return -1; 796 return -1;
797 } 797 }
798 if(s->got_extra_bits){
799 const int size = s->gb_extra_bits.size_in_bits - get_bits_count(&s->gb_extra_bits);
800 const int wanted = s->samples * s->extra_bits << s->stereo_in;
801 if(size < wanted){
802 av_log(avctx, AV_LOG_ERROR, "Too small EXTRABITS\n");
803 s->got_extra_bits = 0;
804 }
805 }
798 806
799 if(s->stereo_in){ 807 if(s->stereo_in){
800 if(bpp == 2) 808 if(bpp == 2)
801 samplecount = wv_unpack_stereo(s, &s->gb, samples, 0); 809 samplecount = wv_unpack_stereo(s, &s->gb, samples, 0);
802 else 810 else