Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>
---
 libavcodec/ffv1.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 8e7542f918..a5f5449602 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -120,19 +120,18 @@ av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
     av_assert0(max_slice_count > 0);
 
     for (i = 0; i < max_slice_count;) {
+        FFV1Context *fs = av_memdup(f, sizeof(*fs));
         int sx          = i % f->num_h_slices;
         int sy          = i / f->num_h_slices;
         int sxs         = f->avctx->width  *  sx      / f->num_h_slices;
         int sxe         = f->avctx->width  * (sx + 1) / f->num_h_slices;
         int sys         = f->avctx->height *  sy      / f->num_v_slices;
         int sye         = f->avctx->height * (sy + 1) / f->num_v_slices;
-        FFV1Context *fs = av_mallocz(sizeof(*fs));
 
         if (!fs)
             goto memfail;
 
         f->slice_context[i] = fs;
-        memcpy(fs, f, sizeof(*fs));
         memset(fs->rc_stat2, 0, sizeof(fs->rc_stat2));
 
         fs->slice_index  = i++;
-- 
2.27.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to