Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-11 21:25:27 +0400
committerMichael Niedermayer <michaelni@gmx.at>2011-11-04 06:32:39 +0400
commitae2d3d6be01a520b1b3f71510359a99c82631751 (patch)
treed6f178ec1da8842bb19c27f3a9521ed4e8c834fd /libavcodec
parent998fc04bcfeeaa2b0885ee84e37bcd345797981a (diff)
apedec: set s->currentframeblocks after validating nblocks
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/apedec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 260ef2efa0..4d8a9401c1 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -827,7 +827,7 @@ static int ape_decode_frame(AVCodecContext * avctx,
s->ptr = s->last_ptr = s->data;
s->data_end = s->data + buf_size;
- nblocks = s->samples = bytestream_get_be32(&s->ptr);
+ nblocks = bytestream_get_be32(&s->ptr);
n = bytestream_get_be32(&s->ptr);
if(n < 0 || n > 3){
av_log(avctx, AV_LOG_ERROR, "Incorrect offset passed\n");
@@ -836,13 +836,13 @@ static int ape_decode_frame(AVCodecContext * avctx,
}
s->ptr += n;
- s->currentframeblocks = nblocks;
buf += 4;
if (!nblocks || nblocks > INT_MAX) {
av_log(avctx, AV_LOG_ERROR, "Invalid sample count: %u.\n", nblocks);
*data_size = 0;
return AVERROR_INVALIDDATA;
}
+ s->currentframeblocks = s->samples = nblocks;
memset(s->decoded0, 0, sizeof(s->decoded0));
memset(s->decoded1, 0, sizeof(s->decoded1));