summaryrefslogtreecommitdiff
path: root/libavcodec/lzo.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2006-01-14 12:55:20 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2006-01-14 12:55:20 +0000
commitd66fbc14def2a0169ec21c2aaabacbb2056ab579 (patch)
tree1a1a42ad4f0d1427d4690cf0891e1d0da82eb82a /libavcodec/lzo.c
parentf3b60109163dd2850795b9ab6ab54de7fd971ee6 (diff)
Wrong state handling causing decompression errors in some cases
Originally committed as revision 4852 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/lzo.c')
-rw-r--r--libavcodec/lzo.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/lzo.c b/libavcodec/lzo.c
index ef76d6704a..46166a1133 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;