summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-07-12 13:11:51 +0200
committerAnton Khirnov <anton@khirnov.net>2016-07-25 13:57:02 +0200
commit0c5bd04b8626c82c8e397d7beac5e9709428eeb9 (patch)
treeb8d276846bea32eb197b0ce57f7fdfb8df89fe8f
parentc1887a36d0350c404fb42d2e83018d4d2358439f (diff)
cfhd: explicitly initialize all the contexts for frame mt
-rw-r--r--libavcodec/cfhd.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index 4404303294..e14176530d 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -773,6 +773,8 @@ static av_cold int cfhd_init(AVCodecContext *avctx)
{
CFHDContext *s = avctx->priv_data;
+ memset(s, 0, sizeof(*s));
+
s->avctx = avctx;
avctx->bits_per_raw_sample = 10;
@@ -785,23 +787,22 @@ static av_cold int cfhd_close(AVCodecContext *avctx)
free_buffers(s);
- if (!avctx->internal->is_copy) {
- ff_free_vlc(&s->vlc_9);
- ff_free_vlc(&s->vlc_18);
- }
+ ff_free_vlc(&s->vlc_9);
+ ff_free_vlc(&s->vlc_18);
return 0;
}
AVCodec ff_cfhd_decoder = {
- .name = "cfhd",
- .long_name = NULL_IF_CONFIG_SMALL("Cineform HD"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_CFHD,
- .priv_data_size = sizeof(CFHDContext),
- .init = cfhd_init,
- .close = cfhd_close,
- .decode = cfhd_decode,
- .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
+ .name = "cfhd",
+ .long_name = NULL_IF_CONFIG_SMALL("Cineform HD"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_CFHD,
+ .priv_data_size = sizeof(CFHDContext),
+ .init = cfhd_init,
+ .init_thread_copy = ONLY_IF_THREADS_ENABLED(cfhd_init),
+ .close = cfhd_close,
+ .decode = cfhd_decode,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};