changeset 9767:99d5a25c5895 libavcodec

Use bytestream_get_le16 to simplify offset/count calculation for mszh decompression.
author reimar
date Sun, 31 May 2009 10:35:39 +0000
parents ff036b7cab79
children c0af0d67bb8f
files lcldec.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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) {