Fix decoding of interlaced gif, e.g. http://samples.mplayerhq.hu/GIF/7up.gif
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Mon, 3 Mar 2008 13:16:29 +0000 (13:16 +0000)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Mon, 3 Mar 2008 13:16:29 +0000 (13:16 +0000)
Originally committed as revision 12297 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/gifdec.c

index 5803e5e..82a80c8 100644 (file)
@@ -364,11 +364,8 @@ static int gif_read_image(GifState *s)
                 y1 += 8;
                 ptr += linesize * 8;
                 if (y1 >= height) {
-                    y1 = 4;
-                    if (pass == 0)
-                        ptr = ptr1 + linesize * 4;
-                    else
-                        ptr = ptr1 + linesize * 2;
+                    y1 = pass == 0 ? 4 : 2;
+                    ptr = ptr1 + linesize * y1;
                     pass++;
                 }
                 break;