aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/lzw.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-03-25 14:02:54 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-03-25 14:02:54 +0000
commitbf7709619b19ecbdb752b3badf0ec7beb78fd0a4 (patch)
tree92188c7a4b2d85553488f301f7b6602e00115e1d /libavcodec/lzw.c
parent62ef8925c5bbc7b74d3263838f31e8d02bdb9376 (diff)
downloadffmpeg-bf7709619b19ecbdb752b3badf0ec7beb78fd0a4.tar.gz
factorize
Originally committed as revision 8510 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/lzw.c')
-rw-r--r--libavcodec/lzw.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/libavcodec/lzw.c b/libavcodec/lzw.c
index cb12eb8573..240ff13491 100644
--- a/libavcodec/lzw.c
+++ b/libavcodec/lzw.c
@@ -192,13 +192,12 @@ int ff_lzw_decode(LZWState *p, uint8_t *buf, int len){
oc = s->oc;
fc = s->fc;
- while (sp > s->stack) {
- *buf++ = *(--sp);
- if ((--l) == 0)
- goto the_end;
- }
-
for (;;) {
+ while (sp > s->stack) {
+ *buf++ = *(--sp);
+ if ((--l) == 0)
+ goto the_end;
+ }
c = lzw_get_code(s);
if (c == s->end_code) {
s->end_code = -1;
@@ -242,11 +241,6 @@ int ff_lzw_decode(LZWState *p, uint8_t *buf, int len){
s->curmask = mask[++s->cursize];
}
}
- while (sp > s->stack) {
- *buf++ = *(--sp);
- if ((--l) == 0)
- goto the_end;
- }
}
}
the_end: