Merge commit 'daeb4e3042f2ecae2d41aaa4cae0bed932539788'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Jul 2013 14:11:01 +0000 (16:11 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Jul 2013 14:11:01 +0000 (16:11 +0200)
* commit 'daeb4e3042f2ecae2d41aaa4cae0bed932539788':
  jpeg2000: Proper cleanup on failure in decode_frame()

Conflicts:
libavcodec/jpeg2000.c

See: 9d56ccf5

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/jpeg2000.c
libavcodec/jpeg2000dec.c

index 85216f5f4773d133f551f4b93b2ced914bd34738..f044164ed6a695b1c46f908c58d5a1a9ff6851c2 100644 (file)
@@ -501,7 +501,9 @@ void ff_jpeg2000_reinit(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
 void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
 {
     int reslevelno, bandno, precno;
-    for (reslevelno = 0; comp->reslevel && reslevelno < codsty->nreslevels; reslevelno++) {
+    for (reslevelno = 0;
+         comp->reslevel && reslevelno < codsty->nreslevels;
+         reslevelno++) {
         Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno;
 
         for (bandno = 0; bandno < reslevel->nbands; bandno++) {
index 711b298d3fe7a15dc2c47d1d77caaa9b5e562422..7b8a9aa9873a114918ecc102039490443e5428f4 100644 (file)
@@ -1412,8 +1412,6 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
         }
     } else {
         bytestream2_seek(&s->g, 0, SEEK_SET);
-        if (bytestream2_peek_be16(&s->g) != JPEG2000_SOC)
-            bytestream2_skip(&s->g, 8);
     }
 
     if (bytestream2_get_be16u(&s->g) != JPEG2000_SOC) {