render: NULL-protect SetPicturePictFilter()

Even though it shouldn't practically happen, better adding a trivial check,
just in case. The check is really cheap and possibly optimized-out.

| ../render/filter.c: In function ‘SetPicturePictFilter’:
| ../render/filter.c:388:36: warning: dereference of possibly-NULL ‘new_params’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|   388 |         pPicture->filter_params[i] = params[i];
|       |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-05-06 19:02:29 +02:00
parent 67751f6096
commit 5def7f3f64

View File

@ -387,6 +387,7 @@ SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter,
pPicture->filter_nparams = nparams; pPicture->filter_nparams = nparams;
} }
for (i = 0; i < nparams; i++) for (i = 0; i < nparams; i++)
if (pPicture->filter_params)
pPicture->filter_params[i] = params[i]; pPicture->filter_params[i] = params[i];
pPicture->filter = pFilter->id; pPicture->filter = pFilter->id;