Evas avif loader: fix segfault when the avif loader tries to load a non avif image

Test Plan: entice is not crashing

Reviewers: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12254
This commit is contained in:
Vincent Torri 2021-03-31 10:29:50 +01:00 committed by Carsten Haitzler (Rasterman)
parent 15078f757b
commit 769066f606
1 changed files with 6 additions and 1 deletions

View File

@ -250,7 +250,12 @@ evas_image_load_file_close_avif(void *loader_data)
Evas_Loader_Internal *loader;
loader = loader_data;
avifDecoderDestroy(loader->decoder);
/*
* in case _head() fails (because the file is not an avif one),
* loader is not filled and loader->decoder is NULL
*/
if (loader->decoder)
avifDecoderDestroy(loader->decoder);
free(loader_data);
}