[FFmpeg-cvslog] apedec: set s->currentframeblocks after validating nblocks

Justin Ruggles git at videolan.org
Fri Nov 4 13:22:25 CET 2011


ffmpeg | branch: release/0.8 | Justin Ruggles <justin.ruggles at gmail.com> | Tue Oct 11 13:25:27 2011 -0400| [ae2d3d6be01a520b1b3f71510359a99c82631751] | committer: Michael Niedermayer

apedec: set s->currentframeblocks after validating nblocks

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae2d3d6be01a520b1b3f71510359a99c82631751
---

 libavcodec/apedec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 260ef2e..4d8a940 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));



More information about the ffmpeg-cvslog mailing list