[FFmpeg-cvslog] avcodec/cfhdenc: free alpha buffer on closing

Paul B Mahol git at videolan.org
Sat Aug 8 20:59:08 EEST 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Aug  8 19:59:06 2020 +0200| [14b84a2e997945467e445b1d246ee03a0c3ba806] | committer: Paul B Mahol

avcodec/cfhdenc: free alpha buffer on closing

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=14b84a2e997945467e445b1d246ee03a0c3ba806
---

 libavcodec/cfhdenc.c | 5 +++++
 1 file changed, 5 insertions(+)

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;
 }
 



More information about the ffmpeg-cvslog mailing list