changeset 3041:241b3a9bbd0c libavcodec

Wrong state handling causing decompression errors in some cases
author reimar
date Sat, 14 Jan 2006 12:55:20 +0000
parents 6a388c616fa3
children a434a3752e78
files lzo.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lzo.c	Sat Jan 14 03:39:02 2006 +0000
+++ b/lzo.c	Sat Jan 14 12:55:20 2006 +0000
@@ -118,7 +118,6 @@
     while (!c.error) {
         int cnt, back;
         if (x >> 4) {
-            state = BACKPTR;
             if (x >> 6) {
                 cnt = (x >> 5) - 1;
                 back = (get_byte(&c) << 3) + ((x >> 2) & 7) + 1;
@@ -155,10 +154,9 @@
         }
         copy_backptr(&c, back, cnt + 2);
         cnt = x & 3;
+        state = cnt ? BACKPTR : COPY;
         if (cnt)
             copy(&c, cnt);
-        else
-            state = (state == COPY) ? BACKPTR : COPY;
         x = get_byte(&c);
     }
     *inlen = c.in_end - c.in;