# HG changeset patch # User reimar # Date 1243766139 0 # Node ID 99d5a25c5895ef875dfbc195ca6a39721f721b32 # Parent ff036b7cab79ab6bbac9d514440b1f3a14a9134c Use bytestream_get_le16 to simplify offset/count calculation for mszh decompression. diff -r ff036b7cab79 -r 99d5a25c5895 lcldec.c --- a/lcldec.c Sun May 31 10:31:37 2009 +0000 +++ b/lcldec.c Sun May 31 10:35:39 2009 +0000 @@ -43,6 +43,7 @@ #include "avcodec.h" #include "get_bits.h" +#include "bytestream.h" #include "lcl.h" #if CONFIG_ZLIB_DECODER @@ -96,10 +97,8 @@ destptr += 4; srcptr += 4; } else { - ofs = *srcptr++; - cnt = *srcptr++; - ofs += cnt * 256; - cnt = (cnt >> 3) + 1; + ofs = bytestream_get_le16(&srcptr); + cnt = (ofs >> 11) + 1; ofs &= 0x7ff; cnt *= 4; if (destptr_end - destptr < cnt) {