Merge commit 'c697c590fbf296b1679b80c8f4071e4c8a6c884b'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 3 Aug 2014 16:58:19 +0000 (18:58 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 3 Aug 2014 16:58:19 +0000 (18:58 +0200)
* commit 'c697c590fbf296b1679b80c8f4071e4c8a6c884b':
  lcl: Disentangle pointers to input data and decompression buffer

Conflicts:
libavcodec/lcldec.c

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

@@@ -192,18 -186,12 +191,18 @@@ static int decode_frame(AVCodecContext 
      case AV_CODEC_ID_MSZH:
          switch (c->compression) {
          case COMP_MSZH:
 -            if (c->flags & FLAG_MULTITHREAD) {
 +            if (c->imgtype == IMGTYPE_RGB24 && len == width * height * 3) {
 +                ;
 +            } else if (c->flags & FLAG_MULTITHREAD) {
-                 mthread_inlen = AV_RL32(encoded);
+                 mthread_inlen = AV_RL32(buf);
 +                if (len < 8) {
 +                    av_log(avctx, AV_LOG_ERROR, "len %d is too small\n", len);
 +                    return AVERROR_INVALIDDATA;
 +                }
                  mthread_inlen = FFMIN(mthread_inlen, len - 8);
-                 mthread_outlen = AV_RL32(encoded+4);
+                 mthread_outlen = AV_RL32(buf + 4);
                  mthread_outlen = FFMIN(mthread_outlen, c->decomp_size);
-                 mszh_dlen = mszh_decomp(encoded + 8, mthread_inlen, c->decomp_buf, c->decomp_size);
+                 mszh_dlen = mszh_decomp(buf + 8, mthread_inlen, c->decomp_buf, c->decomp_size);
                  if (mthread_outlen != mszh_dlen) {
                      av_log(avctx, AV_LOG_ERROR, "Mthread1 decoded size differs (%d != %d)\n",
                             mthread_outlen, mszh_dlen);