[PATCH i-g-t v12 02/11] lib/intel_batchbuffer: handle base64 encode fail
Kamil Konieczny
kamil.konieczny at linux.intel.com
Tue Jun 3 15:14:08 UTC 2025
Hi Jeevaka,
On 2025-06-02 at 19:25:06 +0000, Jeevaka Prabu Badrappan wrote:
> g_base64_encode function returns a newly allocated string containing
> the Base64 encoded data. Upon failure, null can be returned.
>
> When g_base64_encode function fails, exit the calling function.
>
> Signed-off-by: Jeevaka Prabu Badrappan <jeevaka.badrappan at intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> ---
> lib/intel_batchbuffer.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> index f7569e768..03ce65ded 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -2348,6 +2348,9 @@ static void intel_bb_dump_base64(struct intel_bb *ibb, int linelen)
>
> igt_info("--- bb ---\n");
> pos = str = g_base64_encode((const guchar *) ibb->batch, ibb->size);
> + if (str == NULL)
> + return;
> +
> outsize = strlen(str);
>
> while (outsize > 0) {
> --
> 2.49.0
>
More information about the igt-dev
mailing list