aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/flac.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2008-05-04 01:07:46 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2008-05-04 01:07:46 +0000
commit0ec7b71de82442bb4ff6398bb2c7ec7e9f6e4f57 (patch)
tree633098c780d260ba0177ecca652ff8e77a56471b /libavcodec/flac.c
parentf7739f3708f786a0b071d8d8b59331525b0ccfd8 (diff)
downloadffmpeg-0ec7b71de82442bb4ff6398bb2c7ec7e9f6e4f57.tar.gz
Do not read out of array bounds.
Originally committed as revision 13053 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flac.c')
-rw-r--r--libavcodec/flac.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/flac.c b/libavcodec/flac.c
index d2cc3831f1..2e8e99b9d3 100644
--- a/libavcodec/flac.c
+++ b/libavcodec/flac.c
@@ -279,9 +279,13 @@ static int decode_subframe_fixed(FLACContext *s, int channel, int pred_order)
if (decode_residuals(s, channel, pred_order) < 0)
return -1;
+ if(pred_order > 0)
a = decoded[pred_order-1];
+ if(pred_order > 1)
b = a - decoded[pred_order-2];
+ if(pred_order > 2)
c = b - decoded[pred_order-2] + decoded[pred_order-3];
+ if(pred_order > 3)
d = c - decoded[pred_order-2] + 2*decoded[pred_order-3] - decoded[pred_order-4];
switch(pred_order)