diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-11 13:25:27 -0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-04 03:32:39 +0100 |
commit | ae2d3d6be01a520b1b3f71510359a99c82631751 (patch) | |
tree | d6f178ec1da8842bb19c27f3a9521ed4e8c834fd /libavcodec | |
parent | 998fc04bcfeeaa2b0885ee84e37bcd345797981a (diff) | |
download | ffmpeg-ae2d3d6be01a520b1b3f71510359a99c82631751.tar.gz |
apedec: set s->currentframeblocks after validating nblocks
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 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)); |