[FFmpeg-cvslog] avcodec/diracdec: Move buf[] read after size check

Michael Niedermayer git at videolan.org
Tue May 5 22:19:41 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue May  5 22:01:58 2015 +0200| [5a455dd011151fd7e3f8aced745b206ca1413d29] | committer: Michael Niedermayer

avcodec/diracdec: Move buf[] read after size check

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/diracdec.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 0453a97..4230a06 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1815,12 +1815,14 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
 {
     DiracContext *s   = avctx->priv_data;
     DiracFrame *pic   = NULL;
-    int ret, i, parse_code = buf[4];
+    int ret, i, parse_code;
     unsigned tmp;
 
     if (size < DATA_UNIT_HEADER_SIZE)
         return -1;
 
+    parse_code = buf[4];
+
     init_get_bits(&s->gb, &buf[13], 8*(size - DATA_UNIT_HEADER_SIZE));
 
     if (parse_code == pc_seq_header) {



More information about the ffmpeg-cvslog mailing list