Commit 66311f86 authored by Laurent Aimar's avatar Laurent Aimar Committed by Kostya Shishkov
Browse files

Check whether extra bits block has enough data.

Patch by Laurent Aimar "f\145nr\151r >at< vide\157lan <dot> o\162g"

Originally committed as revision 18732 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 241f5eab
...@@ -795,6 +795,14 @@ static int wavpack_decode_frame(AVCodecContext *avctx, ...@@ -795,6 +795,14 @@ static int wavpack_decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Packed samples not found\n"); av_log(avctx, AV_LOG_ERROR, "Packed samples not found\n");
return -1; 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(s->stereo_in){
if(bpp == 2) if(bpp == 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment