root frame gap should be set to the gap of the first received frame

This commit is contained in:
Kovid Goyal
2021-01-29 14:26:32 +05:30
parent ad4665e638
commit 597267d1d0
2 changed files with 9 additions and 9 deletions

View File

@@ -908,7 +908,7 @@ handle_animation_frame_load_command(GraphicsManager *self, GraphicsCommand *g, I
ABRT("ENOSPC", "Failed to cache data for image frame");
}
if (is_new_frame) {
if (!img->extra_framecnt) img->root_frame.gap = DEFAULT_GAP;
if (!img->extra_framecnt) img->root_frame.gap = g->_gap > 0 ? g->_gap : DEFAULT_GAP;
Frame *frames = realloc(img->extra_frames, sizeof(img->extra_frames[0]) * img->extra_framecnt + 1);
if (!frames) ABRT("ENOMEM", "Out of memory");
img->extra_frames = frames;