File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -169,8 +169,11 @@ init( PImgCodecInfo * info, void * param)
169169 {
170170 struct heif_encoder_descriptor * enc [1024 ];
171171 int i , n ;
172+ struct heif_context * ctx ;
172173
173- n = get_encoder_descriptors (NULL , heif_compression_undefined , NULL ,
174+ ctx = heif_context_alloc ();
175+
176+ n = get_encoder_descriptors (ctx , heif_compression_undefined , NULL ,
174177 (const struct heif_encoder_descriptor * * ) enc , 1024 );
175178 for ( i = 0 ; i < n ; i ++ ) {
176179 char buf [2048 ], * compstr ;
@@ -220,6 +223,7 @@ init( PImgCodecInfo * info, void * param)
220223 prima_hash_store (encoders , shrt , strlen (shrt ), (void * )v );
221224 }
222225 }
226+ heif_context_free (ctx );
223227 if ( n > 0 )
224228 codec_info .IOFlags |= IMG_SAVE_TO_FILE | IMG_SAVE_TO_STREAM | IMG_SAVE_MULTIFRAME ;
225229 }
You can’t perform that action at this time.
0 commit comments