changeset 4366:f8753597422c libavcodec

Fix crash when pred_order greater s->blocksize >> rice_order. Fixes http://sam.zoy.org/zzuf/lol-mplayer.flac
author reimar
date Sun, 21 Jan 2007 09:55:28 +0000
parents 9cebff821565
children b885917fbfef
files flac.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flac.c	Sat Jan 20 13:50:00 2007 +0000
+++ b/flac.c	Sun Jan 21 09:55:28 2007 +0000
@@ -225,6 +225,10 @@
     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;