[FFmpeg-cvslog] avcodec/svq1enc: Don't free scratchbuf upon error

Andreas Rheinhardt git at videolan.org
Sat Jun 21 23:20:28 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Jun 12 21:28:03 2025 +0200| [1fe08d629a27cc5a71a4a52105121a1e64d66ce8] | committer: Andreas Rheinhardt

avcodec/svq1enc: Don't free scratchbuf upon error

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>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1fe08d629a27cc5a71a4a52105121a1e64d66ce8
---

 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;
         }
     }



More information about the ffmpeg-cvslog mailing list