Merge commit 'd3cb302b88503c3111e25add196622110c056188'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Jul 2013 11:20:57 +0000 (13:20 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Jul 2013 11:28:35 +0000 (13:28 +0200)
* commit 'd3cb302b88503c3111e25add196622110c056188':
  jpeg2000: Validate SOT parsing

Conflicts:
libavcodec/jpeg2000dec.c

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

@@@ -463,11 -422,14 +463,12 @@@ static int get_sot(Jpeg2000DecoderConte
      if (bytestream2_get_bytes_left(&s->g) < 8)
          return AVERROR_INVALIDDATA;
  
-     s->curtileno = Isot = bytestream2_get_be16u(&s->g);        // Isot
-     if ((unsigned)s->curtileno >= s->numXtiles * s->numYtiles) {
-         s->curtileno=0;
++    s->curtileno = 0;
+     Isot = bytestream2_get_be16u(&s->g);        // Isot
+     if (Isot >= s->numXtiles * s->numYtiles)
          return AVERROR_INVALIDDATA;
-     }
 -    if (Isot) {
 -        avpriv_request_sample(s->avctx, "Support for more than one tile");
 -        return AVERROR_PATCHWELCOME;
 -    }
++    s->curtileno = Isot;
      Psot  = bytestream2_get_be32u(&s->g);       // Psot
      TPsot = bytestream2_get_byteu(&s->g);       // TPsot