]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'fbcc03db8f3919e2ea46d6ad11a00906b1c0ef0e'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Jul 2013 09:55:45 +0000 (11:55 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Jul 2013 09:55:45 +0000 (11:55 +0200)
* commit 'fbcc03db8f3919e2ea46d6ad11a00906b1c0ef0e':
  jpeg2000: Check code-block size

Conflicts:
libavcodec/jpeg2000dec.c

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

index 043ec03a2ed8e5f359917750a9cc699409de5a80,8fbe3493eff3bdec771a52f09712efe2381acbba..8e582aa2cf9d2277eea495e47aa6f5d55d58c225
@@@ -280,11 -264,11 +280,11 @@@ static int get_cox(Jpeg2000DecoderConte
      else
          c->nreslevels2decode = c->nreslevels - s->reduction_factor;
  
 -    c->log2_cblk_width  = bytestream_get_byte(&s->buf) + 2; // cblk width
 -    c->log2_cblk_height = bytestream_get_byte(&s->buf) + 2; // cblk height
 +    c->log2_cblk_width  = (bytestream2_get_byteu(&s->g) & 15) + 2; // cblk width
 +    c->log2_cblk_height = (bytestream2_get_byteu(&s->g) & 15) + 2; // cblk height
  
      if (c->log2_cblk_width > 10 || c->log2_cblk_height > 10 ||
-         c->log2_cblk_width + c->log2_cblk_height > 14) {
+         c->log2_cblk_width + c->log2_cblk_height > 12) {
          av_log(s->avctx, AV_LOG_ERROR, "cblk size invalid\n");
          return AVERROR_INVALIDDATA;
      }