]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/gif.c
Merge commit '31dc73e92a96f08d07650c0e7d31c0b9a1465d46'
[ffmpeg] / libavcodec / gif.c
index 12a039e8dccc090622ec58b5cc94013ce299519a..cf5d438a7283ac45b048a273d8fe5a0a87a1315c 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "put_bits.h"
 
-typedef struct {
+typedef struct GIFContext {
     const AVClass *class;
     LZWState *lzw;
     uint8_t *buf;
@@ -108,7 +108,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
         /* skip common columns */
         while (x_start < x_end) {
             int same_column = 1;
-            for (y = y_start; y < y_end; y++) {
+            for (y = y_start; y <= y_end; y++) {
                 if (ref[y*ref_linesize + x_start] != buf[y*linesize + x_start]) {
                     same_column = 0;
                     break;
@@ -120,7 +120,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
         }
         while (x_end > x_start) {
             int same_column = 1;
-            for (y = y_start; y < y_end; y++) {
+            for (y = y_start; y <= y_end; y++) {
                 if (ref[y*ref_linesize + x_end] != buf[y*linesize + x_end]) {
                     same_column = 0;
                     break;