]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cfhd: properly handle midstream size changes for transform type 2
authorPaul B Mahol <onemda@gmail.com>
Wed, 23 Dec 2020 11:34:14 +0000 (12:34 +0100)
committerPaul B Mahol <onemda@gmail.com>
Fri, 25 Dec 2020 12:28:39 +0000 (13:28 +0100)
libavcodec/cfhd.c

index a2b9c7c76a97e04e15aece91c2ba2bb1461ed934..17ddcdd2df5064fe2e28487a2031842d1d18bae8 100644 (file)
@@ -1372,6 +1372,12 @@ 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 ||
+        pdst->a_format != psrc->a_format ||
+        pdst->a_width != psrc->a_width ||
+        pdst->a_height != psrc->a_height)
+        free_buffers(pdst);
+
     pdst->a_format = psrc->a_format;
     pdst->a_width  = psrc->a_width;
     pdst->a_height = psrc->a_height;