aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/avcodec.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-06-28 15:13:04 +0200
committerNiklas Haas <git@haasn.dev>2022-07-30 11:42:06 +0200
commitc688ddc067e0d9ade731b3adb5c6fde259cbc5f6 (patch)
treebcd91c7df14d55ecebde29425ee1af4c6b0b509c /libavcodec/avcodec.c
parente1a0f2df3d8c150016bfa2f0dfde7d6b56c6bf3f (diff)
downloadffmpeg-c688ddc067e0d9ade731b3adb5c6fde259cbc5f6.tar.gz
avcodec: add common fflcms2 boilerplate
Handling this in general code makes more sense than handling it in individual codec files, because it would be a lot of unnecessary code duplication for the plenty of formats that support exporting ICC profiles (jpg, png, tiff, webp, jxl, ...). encode.c and decode.c will be in charge of initializing this state as needed, so we merely need to make sure to uninit it afterwards from the common destructor path. Signed-off-by: Niklas Haas <git@haasn.dev>
Diffstat (limited to 'libavcodec/avcodec.c')
-rw-r--r--libavcodec/avcodec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index 4bc18183a9..c9105c5df2 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -479,6 +479,10 @@ av_cold int avcodec_close(AVCodecContext *avctx)
av_channel_layout_uninit(&avci->initial_ch_layout);
+#if CONFIG_LCMS2
+ ff_icc_context_uninit(&avci->icc);
+#endif
+
av_freep(&avctx->internal);
}