Skip to content

Commit 02bc7dc

Browse files
committed
newest way to get list of encoders
1 parent fe5b9ed commit 02bc7dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

img/codec_heif.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)