1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavc/gif: avoid encoding 0x0 images.

It seems browsers don't like it very much.
This commit is contained in:
Clément Bœsch 2013-04-18 15:29:44 +02:00
parent 9db1c6455e
commit 90a56ebbe5

View File

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