[FFmpeg-devel] [PATCH 2/2] avcodec/cfhd: properly handle midstream size changes for transform type 2

Paul B Mahol onemda at gmail.com
Wed Dec 23 13:35:39 EET 2020


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavcodec/cfhd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index a4f4cb4b3c..ae0d4b9496 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -1372,6 +1372,9 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
     if (dst == src || psrc->transform_type == 0)
         return 0;
 
+    if (pdst->plane[0].idwt_size != psrc->plane[0].idwt_size)
+        free_buffers(pdst);
+
     pdst->a_format = psrc->a_format;
     pdst->a_width  = psrc->a_width;
     pdst->a_height = psrc->a_height;
-- 
2.17.1



More information about the ffmpeg-devel mailing list