Skip to content

Commit

Permalink
Fix disposal method issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jagraff committed May 10, 2019
1 parent d199ea7 commit 9f697ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libavcodec/gif.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ static void gif_crop_translucent(AVCodecContext *avctx,

*height = y_end + 1 - *y_start;
*width = x_end + 1 - *x_start;

av_log(avctx, AV_LOG_DEBUG,"%dx%d image at pos (%d;%d) [area:%dx%d]\n",
*width, *height, *x_start, *y_start, avctx->width, avctx->height);
}
Expand Down Expand Up @@ -267,7 +268,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
int bcid = -1, honor_transparency = (s->flags & GF_TRANSDIFF) && s->last_frame && !palette;
const uint8_t *ptr;

if (!s->image && avctx->frame_number && is_image_translucent(avctx, buf, linesize)) {
if (!s->image && is_image_translucent(avctx, buf, linesize)) {
gif_crop_translucent(avctx, buf, linesize, &width, &height, &x_start, &y_start);
honor_transparency = 0;
disposal = GCE_DISPOSAL_BACKGROUND;
Expand Down

0 comments on commit 9f697ed

Please sign in to comment.