[SCM] libav/experimental: Wrong state handling causing decompression errors in some cases

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:45:58 UTC 2013


The following commit has been merged in the experimental branch:
commit d66fbc14def2a0169ec21c2aaabacbb2056ab579
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date:   Sat Jan 14 12:55:20 2006 +0000

    Wrong state handling causing decompression errors in some cases
    
    Originally committed as revision 4852 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/lzo.c b/libavcodec/lzo.c
index ef76d67..46166a1 100644
--- a/libavcodec/lzo.c
+++ b/libavcodec/lzo.c
@@ -118,7 +118,6 @@ int lzo1x_decode(void *out, int *outlen, void *in, int *inlen) {
     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 @@ int lzo1x_decode(void *out, int *outlen, void *in, int *inlen) {
         }
         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;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list