changeset 9759:5968a9f15535 libavcodec

Correct calculation of compressed input length.
author reimar
date Sun, 31 May 2009 10:01:26 +0000
parents 8ebcc162db3d
children 14b65c693625
files lcldec.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lcldec.c	Sun May 31 09:59:46 2009 +0000
+++ b/lcldec.c	Sun May 31 10:01:26 2009 +0000
@@ -199,7 +199,7 @@
                            mthread_outlen, mszh_dlen);
                     return -1;
                 }
-                mszh_dlen = mszh_decomp(encoded + 8 + mthread_inlen, len - mthread_inlen,
+                mszh_dlen = mszh_decomp(encoded + 8 + mthread_inlen, len - 8 - mthread_inlen,
                                         c->decomp_buf + mthread_outlen, c->decomp_size - mthread_outlen);
                 if (mthread_outlen != mszh_dlen) {
                     av_log(avctx, AV_LOG_ERROR, "Mthread2 decoded size differs (%d != %d)\n",
@@ -242,7 +242,7 @@
             mthread_outlen = FFMIN(mthread_outlen, c->decomp_size);
             ret = zlib_decomp(avctx, encoded + 8, mthread_inlen, 0, mthread_outlen);
             if (ret < 0) return ret;
-            ret = zlib_decomp(avctx, encoded + 8 + mthread_inlen, len - mthread_inlen,
+            ret = zlib_decomp(avctx, encoded + 8 + mthread_inlen, len - 8 - mthread_inlen,
                               mthread_outlen, mthread_outlen);
             if (ret < 0) return ret;
         } else {