summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-04-28 00:30:51 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-28 03:32:29 +0200
commitbe7dc34bcf00b8c5b6503c600e7f6bc9324801ff (patch)
tree14c263aa2f68335c36ba4adcb9819a0751355ba2
parentfb5f3241e40ddcd0686e727ddf925eb9e6065406 (diff)
downloadffmpeg-be7dc34bcf00b8c5b6503c600e7f6bc9324801ff.tar.gz
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: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 464c49155ce7ffc88ed39eb2511e7a75565c24be) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/apedec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 325f36d6a6..f6de304006 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1471,13 +1471,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "Invalid sample count: %u.\n", nblocks);
return AVERROR_INVALIDDATA;
}
- s->samples = nblocks;
/* Initialize the frame decoder */
if (init_frame_decoder(s) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error reading frame header\n");
return AVERROR_INVALIDDATA;
}
+ s->samples = nblocks;
}
if (!s->data) {