[FFmpeg-devel] [PATCH 13/47] avcodec/svq1enc: Don't free scratchbuf upon error

Andreas Rheinhardt ffmpegagent at gmail.com
Sun Jun 15 19:54:04 EEST 2025


From: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

Forgotten in 65015003f5c4b83a8202abfa7420ccf37cde6ce3;
after said commit, freeing scratchbuf on error in svq1_encode_frame()
could lead to segfaults lateron, because the buffer will not
be allocated again.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/svq1enc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 3b8738c14f..dae931fb10 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -681,7 +681,6 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                 av_freep(&s->motion_val8[j]);
                 av_freep(&s->motion_val16[j]);
             }
-            av_freep(&s->scratchbuf);
             return -1;
         }
     }
-- 
ffmpeg-codebot



More information about the ffmpeg-devel mailing list