diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-08-08 19:59:06 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-08-08 19:59:06 +0200 |
commit | 14b84a2e997945467e445b1d246ee03a0c3ba806 (patch) | |
tree | 4eb52b831e35cedac61d4f447728aa96b9501e81 /libavcodec/cfhdenc.c | |
parent | 0a8742a1e6644ab8622e43789d51f78415b84d42 (diff) | |
download | ffmpeg-14b84a2e997945467e445b1d246ee03a0c3ba806.tar.gz |
avcodec/cfhdenc: free alpha buffer on closing
Diffstat (limited to 'libavcodec/cfhdenc.c')
-rw-r--r-- | libavcodec/cfhdenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/cfhdenc.c b/libavcodec/cfhdenc.c index 8030413548..d53604ae11 100644 --- a/libavcodec/cfhdenc.c +++ b/libavcodec/cfhdenc.c @@ -356,6 +356,9 @@ static av_cold int cfhd_encode_init(AVCodecContext *avctx) s->lut[i] = last; } + if (s->planes != 4) + return 0; + s->alpha = av_calloc(avctx->width * avctx->height, sizeof(*s->alpha)); if (!s->alpha) return AVERROR(ENOMEM); @@ -864,6 +867,8 @@ static av_cold int cfhd_encode_close(AVCodecContext *avctx) s->plane[i].l_h[j] = NULL; } + av_freep(&s->alpha); + return 0; } |