Commit 464c4915 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

apedec: set s->samples only when init_frame_decoder succeeded

Otherwise range_start_decoding is not necessarily run and thus
ctx->rc.range still 0 in range_dec_normalize leading to an infinite
loop.
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8ca170a7
...@@ -1461,13 +1461,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, ...@@ -1461,13 +1461,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
nblocks); nblocks);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
s->samples = nblocks;
/* Initialize the frame decoder */ /* Initialize the frame decoder */
if (init_frame_decoder(s) < 0) { if (init_frame_decoder(s) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error reading frame header\n"); av_log(avctx, AV_LOG_ERROR, "Error reading frame header\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
s->samples = nblocks;
} }
if (!s->data) { if (!s->data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment