changeset 31733:7bbcba59cea6

Slightly simplify rle decoding.
author reimar
date Sun, 25 Jul 2010 09:41:30 +0000
parents 0cf0df0ed136
children 34d5db2f24ba
files spudec.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/spudec.c	Sun Jul 25 09:33:49 2010 +0000
+++ b/spudec.c	Sun Jul 25 09:41:30 2010 +0000
@@ -300,13 +300,12 @@
     unsigned int rle = 0;
     rle = get_nibble(packet);
     if (rle < 0x04) {
-      rle = (rle << 4) | get_nibble(packet);
-      if (rle < 0x10) {
+      if (rle == 0) {
 	rle = (rle << 4) | get_nibble(packet);
-	if (rle < 0x040) {
+	if (rle < 0x04)
 	  rle = (rle << 4) | get_nibble(packet);
-	}
       }
+      rle = (rle << 4) | get_nibble(packet);
     }
     color = 3 - (rle & 0x3);
     len = rle >> 2;