[FFmpeg-cvslog] avcodec/gif: fix off by one in column offsetting finding

Clément Bœsch git at videolan.org
Mon Feb 16 18:13:00 CET 2015


ffmpeg | branch: release/2.4 | Clément Bœsch <clement at stupeflix.com> | Mon Feb 16 17:23:34 2015 +0100| [dbda57469456f03ed7ba921b97744751d0ccee39] | committer: Clément Bœsch

avcodec/gif: fix off by one in column offsetting finding

(cherry picked from commit f9240ec01abb097263fe578d2b6fb076bb7b9263)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dbda57469456f03ed7ba921b97744751d0ccee39
---

 libavcodec/gif.c           |    4 ++--
 tests/ref/fate/gifenc-bgr8 |   10 +++++-----
 tests/ref/fate/gifenc-rgb8 |   10 +++++-----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libavcodec/gif.c b/libavcodec/gif.c
index 27d054e..def1b83 100644
--- a/libavcodec/gif.c
+++ b/libavcodec/gif.c
@@ -105,7 +105,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;
@@ -117,7 +117,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;
diff --git a/tests/ref/fate/gifenc-bgr8 b/tests/ref/fate/gifenc-bgr8
index 9f4a593..f3b7772 100644
--- a/tests/ref/fate/gifenc-bgr8
+++ b/tests/ref/fate/gifenc-bgr8
@@ -35,15 +35,15 @@
 0,         33,         33,        1,     4295, 0xf71b0b38, S=1,     1024, 0xf351799f
 0,         34,         34,        1,     2044, 0x5adcb93b, S=1,     1024, 0xf351799f
 0,         35,         35,        1,     3212, 0xcf79eeed, S=1,     1024, 0xf351799f
-0,         36,         36,        1,     2281, 0x68464d30, S=1,     1024, 0xf351799f
+0,         36,         36,        1,     2292, 0xb4386334, S=1,     1024, 0xf351799f
 0,         37,         37,        1,     3633, 0x0010992f, S=1,     1024, 0xf351799f
 0,         38,         38,        1,     3552, 0x23697490, S=1,     1024, 0xf351799f
 0,         39,         39,        1,     3690, 0x62afdbb8, S=1,     1024, 0xf351799f
-0,         40,         40,        1,     1558, 0x7a13e53b, S=1,     1024, 0xf351799f
-0,         41,         41,        1,      940, 0xb1b6cba2, S=1,     1024, 0xf351799f
+0,         40,         40,        1,     1559, 0x5baef54a, S=1,     1024, 0xf351799f
+0,         41,         41,        1,      954, 0xca75ca79, S=1,     1024, 0xf351799f
 0,         42,         42,        1,      273, 0x3687799b, S=1,     1024, 0xf351799f
 0,         43,         43,        1,      930, 0x29f3b0c4, S=1,     1024, 0xf351799f
-0,         44,         44,        1,      271, 0xe7af807c, S=1,     1024, 0xf351799f
+0,         44,         44,        1,      271, 0x305e8094, S=1,     1024, 0xf351799f
 0,         45,         45,        1,      196, 0xf5ab51ee, S=1,     1024, 0xf351799f
 0,         46,         46,        1,     4299, 0x67ec0d55, S=1,     1024, 0xf351799f
 0,         47,         47,        1,     4895, 0xb394406c, S=1,     1024, 0xf351799f
@@ -56,7 +56,7 @@
 0,         54,         54,        1,     5179, 0x860fc6a1, S=1,     1024, 0xf351799f
 0,         55,         55,        1,     5046, 0xce9183d3, S=1,     1024, 0xf351799f
 0,         56,         56,        1,     5140, 0xa6d7b9af, S=1,     1024, 0xf351799f
-0,         57,         57,        1,     4289, 0xb415f717, S=1,     1024, 0xf351799f
+0,         57,         57,        1,     4301, 0x03b6ef3f, S=1,     1024, 0xf351799f
 0,         58,         58,        1,     5079, 0xa8d59e01, S=1,     1024, 0xf351799f
 0,         59,         59,        1,     5284, 0xea34e3b3, S=1,     1024, 0xf351799f
 0,         60,         60,        1,     5426, 0x556a15cd, S=1,     1024, 0xf351799f
diff --git a/tests/ref/fate/gifenc-rgb8 b/tests/ref/fate/gifenc-rgb8
index a894173..d1a990d 100644
--- a/tests/ref/fate/gifenc-rgb8
+++ b/tests/ref/fate/gifenc-rgb8
@@ -35,15 +35,15 @@
 0,         33,         33,        1,     4295, 0xc1850a80, S=1,     1024, 0xcfc8799f
 0,         34,         34,        1,     2044, 0x0440c072, S=1,     1024, 0xcfc8799f
 0,         35,         35,        1,     3212, 0xe91af08f, S=1,     1024, 0xcfc8799f
-0,         36,         36,        1,     2281, 0x6a414aa1, S=1,     1024, 0xcfc8799f
+0,         36,         36,        1,     2292, 0x6765633e, S=1,     1024, 0xcfc8799f
 0,         37,         37,        1,     3633, 0xac779aa3, S=1,     1024, 0xcfc8799f
 0,         38,         38,        1,     3552, 0xed2c75b2, S=1,     1024, 0xcfc8799f
 0,         39,         39,        1,     3690, 0x2020dd0d, S=1,     1024, 0xcfc8799f
-0,         40,         40,        1,     1558, 0x2c14e4b2, S=1,     1024, 0xcfc8799f
-0,         41,         41,        1,      940, 0x4927cd90, S=1,     1024, 0xcfc8799f
+0,         40,         40,        1,     1559, 0x596ef330, S=1,     1024, 0xcfc8799f
+0,         41,         41,        1,      954, 0xac12c9c5, S=1,     1024, 0xcfc8799f
 0,         42,         42,        1,      273, 0x138c7831, S=1,     1024, 0xcfc8799f
 0,         43,         43,        1,      930, 0xf1c3ae3f, S=1,     1024, 0xcfc8799f
-0,         44,         44,        1,      271, 0x6d338044, S=1,     1024, 0xcfc8799f
+0,         44,         44,        1,      271, 0x921a80af, S=1,     1024, 0xcfc8799f
 0,         45,         45,        1,      196, 0xa5de5322, S=1,     1024, 0xcfc8799f
 0,         46,         46,        1,     4299, 0x5bac0d86, S=1,     1024, 0xcfc8799f
 0,         47,         47,        1,     4895, 0xc43639a6, S=1,     1024, 0xcfc8799f
@@ -56,7 +56,7 @@
 0,         54,         54,        1,     5179, 0x97aac3a1, S=1,     1024, 0xcfc8799f
 0,         55,         55,        1,     5046, 0x836a80cd, S=1,     1024, 0xcfc8799f
 0,         56,         56,        1,     5140, 0xa725c1e7, S=1,     1024, 0xcfc8799f
-0,         57,         57,        1,     4289, 0x7b3afbc0, S=1,     1024, 0xcfc8799f
+0,         57,         57,        1,     4301, 0x0203f239, S=1,     1024, 0xcfc8799f
 0,         58,         58,        1,     5079, 0xb2e7a2de, S=1,     1024, 0xcfc8799f
 0,         59,         59,        1,     5284, 0xb757dfe1, S=1,     1024, 0xcfc8799f
 0,         60,         60,        1,     5426, 0xf9f11e57, S=1,     1024, 0xcfc8799f



More information about the ffmpeg-cvslog mailing list