shared: do not call png_destroy_read_struct() with uninitialized object

If png_create_info_struct() fails, we should pass NULL to
png_destroy_read_struct(), and not the address of the info we just
failed to create.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
Leandro Ribeiro 2024-04-25 13:48:18 -03:00 committed by Pekka Paalanen
parent 13f09a549d
commit 27a8cbeed9
1 changed files with 1 additions and 1 deletions

View File

@ -222,7 +222,7 @@ load_png(FILE *fp)
info = png_create_info_struct(png); info = png_create_info_struct(png);
if (!info) { if (!info) {
png_destroy_read_struct(&png, &info, NULL); png_destroy_read_struct(&png, NULL, NULL);
return NULL; return NULL;
} }