[FFmpeg-cvslog] r19051 - trunk/libavcodec/lcldec.c
reimar
subversion
Sun May 31 12:35:39 CEST 2009
Author: reimar
Date: Sun May 31 12:35:39 2009
New Revision: 19051
Log:
Use bytestream_get_le16 to simplify offset/count calculation for mszh decompression.
Modified:
trunk/libavcodec/lcldec.c
Modified: trunk/libavcodec/lcldec.c
==============================================================================
--- trunk/libavcodec/lcldec.c Sun May 31 12:31:37 2009 (r19050)
+++ trunk/libavcodec/lcldec.c Sun May 31 12:35:39 2009 (r19051)
@@ -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
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) {
More information about the ffmpeg-cvslog
mailing list