changeset 10134:1d71688b4549 libavcodec

Slightly simplify detection of end of compressed data in xan_unpack
author reimar
date Sat, 05 Sep 2009 19:14:44 +0000
parents 45cb3db81201
children a3abf068e05e
files xan.c
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/xan.c	Sat Sep 05 17:28:20 2009 +0000
+++ b/xan.c	Sat Sep 05 19:14:44 2009 +0000
@@ -156,12 +156,8 @@
             av_memcpy_backptr(dest, back, size2);
             dest += size2;
         } else {
-            int finish;
-            size = ((opcode & 0x1f) << 2) + 4;
-
-            finish = size > 0x70;
-            if (finish)
-                size = opcode & 3;
+            int finish = opcode >= 0xfc;
+            size = finish ? opcode & 3 : ((opcode & 0x1f) << 2) + 4;
 
             memcpy(dest, src, size);  dest += size;  src += size;
             if (finish)