From 88d4d09b2b8d24b64e2f0eed7691d5d0cd042fa7 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Thu, 11 Jan 2024 11:11:11 +0000 Subject: adjust logic in image_viewer_load_image The function gdk_pixbuf_animation_new_from_stream may return NULL. Take the branch only if animation is valid. image_viewer.c: In function 'image_viewer_load_image': image_viewer.c:105:16: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if (animation && gdk_pixbuf_animation_is_static_image(animation) Fixes commit e121fc4767e57fd6018997b75d636264049c9ce8 Fixes commit d006355369916eefff3d964d4606e183339418aa Signed-off-by: Olaf Hering --- src/image_viewer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/image_viewer.c b/src/image_viewer.c index ef143b1bc..a936869d7 100644 --- a/src/image_viewer.c +++ b/src/image_viewer.c @@ -106,8 +106,8 @@ static void image_viewer_load_image(ImageViewer *imageviewer) } #if GDK_PIXBUF_MINOR >= 28 - if ((animation && gdk_pixbuf_animation_is_static_image(animation)) || - imageviewer->resize_img || imageviewer->fit_img_height) { + if (animation && (gdk_pixbuf_animation_is_static_image(animation) || + imageviewer->resize_img || imageviewer->fit_img_height)) { pixbuf = gdk_pixbuf_animation_get_static_image(animation); g_object_ref(pixbuf); g_object_unref(animation); base-commit: ab94ee40bf854f51ceafbd26b7dff6e5faf467d9