aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <clement@stupeflix.com>2015-02-16 17:23:34 +0100
committerClément Bœsch <clement@stupeflix.com>2015-02-16 18:20:08 +0100
commitd5b20daeb0e311caa62a899d41c8823c605d117a (patch)
tree5996d3a23a5cddd516e8043da1599249b31305f6
parent86a01362c0e46d155fbfc1ef19f5ba17af3ee69d (diff)
downloadffmpeg-d5b20daeb0e311caa62a899d41c8823c605d117a.tar.gz
avcodec/gif: fix off by one in column offsetting finding
(cherry picked from commit f9240ec01abb097263fe578d2b6fb076bb7b9263)
-rw-r--r--libavcodec/gif.c4
-rw-r--r--tests/ref/fate/gifenc-bgr810
-rw-r--r--tests/ref/fate/gifenc-rgb810
3 files changed, 12 insertions, 12 deletions
diff --git a/libavcodec/gif.c b/libavcodec/gif.c
index 27d054e512..def1b83e9d 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 49db7636ed..5b28b6a486 100644
--- a/tests/ref/fate/gifenc-bgr8
+++ b/tests/ref/fate/gifenc-bgr8
@@ -35,15 +35,15 @@
0, 330, 330, 1, 4295, 0xf71b0b38, S=1, 1024, 0xf351799f
0, 340, 340, 1, 2044, 0x5adcb93b, S=1, 1024, 0xf351799f
0, 350, 350, 1, 3212, 0xcf79eeed, S=1, 1024, 0xf351799f
-0, 360, 360, 1, 2281, 0x68464d30, S=1, 1024, 0xf351799f
+0, 360, 360, 1, 2292, 0xb4386334, S=1, 1024, 0xf351799f
0, 370, 370, 1, 3633, 0x0010992f, S=1, 1024, 0xf351799f
0, 380, 380, 1, 3552, 0x23697490, S=1, 1024, 0xf351799f
0, 390, 390, 1, 3690, 0x62afdbb8, S=1, 1024, 0xf351799f
-0, 400, 400, 1, 1558, 0x7a13e53b, S=1, 1024, 0xf351799f
-0, 410, 410, 1, 940, 0xb1b6cba2, S=1, 1024, 0xf351799f
+0, 400, 400, 1, 1559, 0x5baef54a, S=1, 1024, 0xf351799f
+0, 410, 410, 1, 954, 0xca75ca79, S=1, 1024, 0xf351799f
0, 420, 420, 1, 273, 0x3687799b, S=1, 1024, 0xf351799f
0, 430, 430, 1, 930, 0x29f3b0c4, S=1, 1024, 0xf351799f
-0, 440, 440, 1, 271, 0xe7af807c, S=1, 1024, 0xf351799f
+0, 440, 440, 1, 271, 0x305e8094, S=1, 1024, 0xf351799f
0, 450, 450, 1, 196, 0xf5ab51ee, S=1, 1024, 0xf351799f
0, 460, 460, 1, 4299, 0x67ec0d55, S=1, 1024, 0xf351799f
0, 470, 470, 1, 4895, 0xb394406c, S=1, 1024, 0xf351799f
@@ -56,7 +56,7 @@
0, 540, 540, 1, 5179, 0x860fc6a1, S=1, 1024, 0xf351799f
0, 550, 550, 1, 5046, 0xce9183d3, S=1, 1024, 0xf351799f
0, 560, 560, 1, 5140, 0xa6d7b9af, S=1, 1024, 0xf351799f
-0, 570, 570, 1, 4289, 0xb415f717, S=1, 1024, 0xf351799f
+0, 570, 570, 1, 4301, 0x03b6ef3f, S=1, 1024, 0xf351799f
0, 580, 580, 1, 5079, 0xa8d59e01, S=1, 1024, 0xf351799f
0, 590, 590, 1, 5284, 0xea34e3b3, S=1, 1024, 0xf351799f
0, 600, 600, 1, 5426, 0x556a15cd, S=1, 1024, 0xf351799f
diff --git a/tests/ref/fate/gifenc-rgb8 b/tests/ref/fate/gifenc-rgb8
index 226b26ee1b..6bcdf64619 100644
--- a/tests/ref/fate/gifenc-rgb8
+++ b/tests/ref/fate/gifenc-rgb8
@@ -35,15 +35,15 @@
0, 330, 330, 1, 4295, 0xc1850a80, S=1, 1024, 0xcfc8799f
0, 340, 340, 1, 2044, 0x0440c072, S=1, 1024, 0xcfc8799f
0, 350, 350, 1, 3212, 0xe91af08f, S=1, 1024, 0xcfc8799f
-0, 360, 360, 1, 2281, 0x6a414aa1, S=1, 1024, 0xcfc8799f
+0, 360, 360, 1, 2292, 0x6765633e, S=1, 1024, 0xcfc8799f
0, 370, 370, 1, 3633, 0xac779aa3, S=1, 1024, 0xcfc8799f
0, 380, 380, 1, 3552, 0xed2c75b2, S=1, 1024, 0xcfc8799f
0, 390, 390, 1, 3690, 0x2020dd0d, S=1, 1024, 0xcfc8799f
-0, 400, 400, 1, 1558, 0x2c14e4b2, S=1, 1024, 0xcfc8799f
-0, 410, 410, 1, 940, 0x4927cd90, S=1, 1024, 0xcfc8799f
+0, 400, 400, 1, 1559, 0x596ef330, S=1, 1024, 0xcfc8799f
+0, 410, 410, 1, 954, 0xac12c9c5, S=1, 1024, 0xcfc8799f
0, 420, 420, 1, 273, 0x138c7831, S=1, 1024, 0xcfc8799f
0, 430, 430, 1, 930, 0xf1c3ae3f, S=1, 1024, 0xcfc8799f
-0, 440, 440, 1, 271, 0x6d338044, S=1, 1024, 0xcfc8799f
+0, 440, 440, 1, 271, 0x921a80af, S=1, 1024, 0xcfc8799f
0, 450, 450, 1, 196, 0xa5de5322, S=1, 1024, 0xcfc8799f
0, 460, 460, 1, 4299, 0x5bac0d86, S=1, 1024, 0xcfc8799f
0, 470, 470, 1, 4895, 0xc43639a6, S=1, 1024, 0xcfc8799f
@@ -56,7 +56,7 @@
0, 540, 540, 1, 5179, 0x97aac3a1, S=1, 1024, 0xcfc8799f
0, 550, 550, 1, 5046, 0x836a80cd, S=1, 1024, 0xcfc8799f
0, 560, 560, 1, 5140, 0xa725c1e7, S=1, 1024, 0xcfc8799f
-0, 570, 570, 1, 4289, 0x7b3afbc0, S=1, 1024, 0xcfc8799f
+0, 570, 570, 1, 4301, 0x0203f239, S=1, 1024, 0xcfc8799f
0, 580, 580, 1, 5079, 0xb2e7a2de, S=1, 1024, 0xcfc8799f
0, 590, 590, 1, 5284, 0xb757dfe1, S=1, 1024, 0xcfc8799f
0, 600, 600, 1, 5426, 0xf9f11e57, S=1, 1024, 0xcfc8799f