summaryrefslogtreecommitdiff
path: root/libavcodec/apedec.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-11 13:25:27 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-10-28 11:47:28 -0400
commit52d4fb2a3dd7aea62a06cf8358dc41fdb4913f6f (patch)
treea67da550f7e58055ffaf9ded79a8c029af3526ff /libavcodec/apedec.c
parent2cab5784892c6ae47feb5f1a97445946b3404ac0 (diff)
apedec: set s->currentframeblocks after validating nblocks
Diffstat (limited to 'libavcodec/apedec.c')
-rw-r--r--libavcodec/apedec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index f6ec47039d..9274b231ce 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -841,13 +841,12 @@ 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);
return AVERROR_INVALIDDATA;
}
- s->samples = nblocks;
+ s->currentframeblocks = s->samples = nblocks;
memset(s->decoded0, 0, sizeof(s->decoded0));
memset(s->decoded1, 0, sizeof(s->decoded1));