# HG changeset patch # User kostya # Date 1241329371 0 # Node ID 05661d19f6d2b44d8783ea872cc8022a9bee2ef0 # Parent 483ba97736f869113b077e1e46c0d4bf683a86dd Check whether extra bits block has enough data. Patch by Laurent Aimar "f\145nr\151r >at< vide\157lan o\162g" diff -r 483ba97736f8 -r 05661d19f6d2 wavpack.c --- a/wavpack.c Sat May 02 09:12:03 2009 +0000 +++ b/wavpack.c Sun May 03 05:42:51 2009 +0000 @@ -795,6 +795,14 @@ av_log(avctx, AV_LOG_ERROR, "Packed samples not found\n"); return -1; } + if(s->got_extra_bits){ + const int size = s->gb_extra_bits.size_in_bits - get_bits_count(&s->gb_extra_bits); + const int wanted = s->samples * s->extra_bits << s->stereo_in; + if(size < wanted){ + av_log(avctx, AV_LOG_ERROR, "Too small EXTRABITS\n"); + s->got_extra_bits = 0; + } + } if(s->stereo_in){ if(bpp == 2)