]> git.sesse.net Git - ffmpeg/commitdiff
lavc/gif: avoid encoding 0x0 images.
authorClément Bœsch <ubitux@gmail.com>
Thu, 18 Apr 2013 13:29:44 +0000 (15:29 +0200)
committerClément Bœsch <ubitux@gmail.com>
Thu, 18 Apr 2013 13:30:02 +0000 (15:30 +0200)
It seems browsers don't like it very much.

libavcodec/gif.c

index f30297b5f83879898818bcb37fe87c3b81b7f0df..b35cfd1b46ee2be60ed774ac66f1ef1067a6e804 100644 (file)
@@ -87,7 +87,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
             y_end = avctx->height - 1;
 
         /* skip common lines */
-        while (y_start < height) {
+        while (y_start < y_end) {
             if (memcmp(ref + y_start*ref_linesize, buf + y_start*linesize, width))
                 break;
             y_start++;
@@ -100,7 +100,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
         height = y_end + 1 - y_start;
 
         /* skip common columns */
-        while (x_start < width) {
+        while (x_start < x_end) {
             int same_column = 1;
             for (y = y_start; y < y_end; y++) {
                 if (ref[y*ref_linesize + x_start] != buf[y*linesize + x_start]) {