From: Karthik B S <karthik.b.s@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
<igt-dev@lists.freedesktop.org>
Cc: Swati Sharma <swati2.sharma@intel.com>
Subject: Re: [PATCH i-g-t v1 1/3] lib/igt_fb: Add check before loading PNG file
Date: Tue, 26 Aug 2025 13:18:31 +0530 [thread overview]
Message-ID: <ca2ad08d-e1d7-4687-80c4-8ef82ea6ab77@intel.com> (raw)
In-Reply-To: <20250819155058.129794-2-kamil.konieczny@linux.intel.com>
On 8/19/2025 9:20 PM, Kamil Konieczny wrote:
> In some configurations loading PNG data file fails simply because
> file was not found on path or it wasn't copied during
> installation. This in turn ends up in SIGSEGV error in cairo lib.
> Call cairo lib only when file open actually succeeded.
>
> Cc: Karthik B S <karthik.b.s@intel.com>
> Cc: Swati Sharma <swati2.sharma@intel.com>
> Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
> ---
> lib/igt_fb.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index 9fc1bfc65..f42f37917 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -2028,12 +2028,14 @@ stdio_read_func(void *closure, unsigned char* data, unsigned int size)
>
> cairo_surface_t *igt_cairo_image_surface_create_from_png(const char *filename)
> {
> - cairo_surface_t *image;
> + cairo_surface_t *image = NULL;
> FILE *f;
>
> f = igt_fopen_data(filename);
> - image = cairo_image_surface_create_from_png_stream(&stdio_read_func, f);
> - fclose(f);
> + if (f) {
> + image = cairo_image_surface_create_from_png_stream(&stdio_read_func, f);
> + fclose(f);
> + }
>
> return image;
> }
next prev parent reply other threads:[~2025-08-26 7:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 15:50 [PATCH i-g-t v1 0/3] Convert kms_3d into subtest Kamil Konieczny
2025-08-19 15:50 ` [PATCH i-g-t v1 1/3] lib/igt_fb: Add check before loading PNG file Kamil Konieczny
2025-08-26 7:48 ` Karthik B S [this message]
2025-08-19 15:50 ` [PATCH i-g-t v1 2/3] tests/kms_3d: Convert to subtest Kamil Konieczny
2025-08-26 8:00 ` Karthik B S
2025-08-19 15:50 ` [PATCH i-g-t v1 3/3] tests/kms_3d: Add resources cleanup Kamil Konieczny
2025-08-26 8:02 ` Karthik B S
2025-08-19 17:24 ` ✓ i915.CI.BAT: success for Convert kms_3d into subtest Patchwork
2025-08-19 17:35 ` ✓ Xe.CI.BAT: " Patchwork
2025-08-20 4:16 ` ✗ i915.CI.Full: failure " Patchwork
2025-08-20 8:41 ` Kamil Konieczny
2025-08-20 12:31 ` ✗ Xe.CI.Full: " Patchwork
2025-08-20 13:47 ` Kamil Konieczny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ca2ad08d-e1d7-4687-80c4-8ef82ea6ab77@intel.com \
--to=karthik.b.s@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=swati2.sharma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.