diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2007-01-21 09:55:28 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2007-01-21 09:55:28 +0000 |
commit | 5484dad7f6122a4d4dbc28e867a8c71d22ba2297 (patch) | |
tree | 3b63aabdd58eb17c70dabbc337a448a853f39484 /libavcodec/flac.c | |
parent | edb6e506828cc0ebbbf3c45701479ddab17045be (diff) | |
download | ffmpeg-5484dad7f6122a4d4dbc28e867a8c71d22ba2297.tar.gz |
Fix crash when pred_order greater s->blocksize >> rice_order.
Fixes http://sam.zoy.org/zzuf/lol-mplayer.flac
Originally committed as revision 7595 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flac.c')
-rw-r--r-- | libavcodec/flac.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/flac.c b/libavcodec/flac.c index e704d990e3..1016ed47f6 100644 --- a/libavcodec/flac.c +++ b/libavcodec/flac.c @@ -225,6 +225,10 @@ static int decode_residuals(FLACContext *s, int channel, int pred_order) rice_order = get_bits(&s->gb, 4); samples= s->blocksize >> rice_order; + if (pred_order > samples) { + av_log(s->avctx, AV_LOG_ERROR, "invalid predictor order: %i > %i\n", pred_order, samples); + return -1; + } sample= i= pred_order; |