diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-04-29 20:39:22 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-05-08 11:10:51 +0200 |
commit | 295e05a762332c5edcc84c325e94457815a51b5c (patch) | |
tree | 98656747c3a166bc43178feac1264e99a4ff989e /libavcodec | |
parent | e0010bb91fc0b067be8aefd2f77e6838537da433 (diff) | |
download | ffmpeg-295e05a762332c5edcc84c325e94457815a51b5c.tar.gz |
ape: Support _0000 files with nblock smaller than 64
The decode_array_0000 assumed that 64 is the minimal block size
while it is not.
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/apedec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 344c85bff0..131c6f32d7 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -614,12 +614,12 @@ static void decode_array_0000(APEContext *ctx, GetBitContext *gb, int ksummax, ksummin; rice->ksum = 0; - for (i = 0; i < 5; i++) { + for (i = 0; i < FFMIN(blockstodecode, 5); i++) { out[i] = get_rice_ook(&ctx->gb, 10); rice->ksum += out[i]; } rice->k = av_log2(rice->ksum / 10) + 1; - for (; i < 64; i++) { + for (; i < FFMIN(blockstodecode, 64); i++) { out[i] = get_rice_ook(&ctx->gb, rice->k); rice->ksum += out[i]; rice->k = av_log2(rice->ksum / ((i + 1) * 2)) + 1; |