1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Do not read out of array bounds.

Originally committed as revision 13053 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Ramiro Polla 2008-05-04 01:07:46 +00:00
parent f7739f3708
commit 0ec7b71de8

View File

@ -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)