avcodec/jpeg2000dec: Zero code and quant style
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 31 Aug 2013 01:35:49 +0000 (03:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 3 Oct 2013 17:03:56 +0000 (19:03 +0200)
This prevents future frames from using half initialized/inconsistent
structures
Fixes assertion failure
Fixes Ticket2897

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/jpeg2000dec.c

index 9fc86d6..26cacd5 100644 (file)
@@ -1364,6 +1364,8 @@ static void jpeg2000_dec_cleanup(Jpeg2000DecoderContext *s)
         }
     }
     av_freep(&s->tile);
+    memset(s->codsty, 0, sizeof(s->codsty));
+    memset(s->qntsty, 0, sizeof(s->qntsty));
     s->numXtiles = s->numYtiles = 0;
 }