diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-05-31 10:35:39 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-05-31 10:35:39 +0000 |
commit | 2bee59083d97754364f2b507cfd25c0c7b2199fa (patch) | |
tree | 9b889775ec178c59a3102511d0c85749bfe82602 | |
parent | 5a18221ba844858905c3a84ce2f9851ac88a53da (diff) | |
download | ffmpeg-2bee59083d97754364f2b507cfd25c0c7b2199fa.tar.gz |
Use bytestream_get_le16 to simplify offset/count calculation for mszh decompression.
Originally committed as revision 19051 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/lcldec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 6bd4556d0a..772cc95172 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -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 @@ static unsigned int mszh_decomp(unsigned char * srcptr, int srclen, unsigned cha 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) { |