From bd88e8bd18b3c9cbbda5437493a6b38507b71a26 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 05f600e5826ab4fd43e345b87bf1029c1fef48f7 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 30aaf1043..a2778a58b 100644 --- a/src/image_viewer.c +++ b/src/image_viewer.c @@ -107,8 +107,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: b92ec902b5b47737415d7a99c5b6c69e4df8c813