[FFmpeg-devel] [PATCH 05/39] lavc/ffv1dec: drop a pointless variable in decode_slice()

Anton Khirnov anton at khirnov.net
Tue Jul 16 20:11:20 EEST 2024


fsdst is by construction always equal to fs, there is even an
av_assert1() checking that. Just use fs directly.
---
 libavcodec/ffv1dec.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 60d04f04b9..dbb7e082a3 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -267,16 +267,14 @@ static int decode_slice(AVCodecContext *c, void *arg)
 
     if(f->fsrc && !(p->flags & AV_FRAME_FLAG_KEY)) {
         FFV1Context *fssrc = f->fsrc->slice_context[si];
-        FFV1Context *fsdst = f->slice_context[si];
-        av_assert1(fsdst->plane_count == fssrc->plane_count);
-        av_assert1(fsdst == fs);
+        av_assert1(fs->plane_count == fssrc->plane_count);
 
         if (!(p->flags & AV_FRAME_FLAG_KEY))
-            fsdst->slice_damaged |= fssrc->slice_damaged;
+            fs->slice_damaged |= fssrc->slice_damaged;
 
         for (int i = 0; i < f->plane_count; i++) {
             PlaneContext *psrc = &fssrc->plane[i];
-            PlaneContext *pdst = &fsdst->plane[i];
+            PlaneContext *pdst = &fs->plane[i];
 
             av_free(pdst->state);
             av_free(pdst->vlc_state);
-- 
2.43.0



More information about the ffmpeg-devel mailing list