ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Mon Mar 17 10:10:32 2025 +0100| [d76ae08048680811bf8a0891a29248c379545ac1] | 
committer: Andreas Rheinhardt

avcodec/svq1enc: Don't add to NULL

It is undefined behavior. Pass a dummy buffer instead.
Fixes "runtime error: applying non-zero offset 1024 to null pointer".
affected the SVQ1 vsynth FATE tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

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

 libavcodec/svq1enc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 40e3fd0045..cf0ab64d79 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -444,8 +444,8 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
                     put_bits(&s->reorder_pb[5], SVQ1_BLOCK_INTRA_LEN, 
SVQ1_BLOCK_INTRA_CODE);
                     score[0] = SVQ1_BLOCK_INTRA_LEN * lambda;
                 }
-                score[0] += encode_block(s, src + 16 * x, NULL, temp, stride,
-                                         5, 64, lambda, 1);
+                score[0] += encode_block(s, src + 16 * x, src + 16 * x /* 
unused */,
+                                         temp, stride, 5, 64, lambda, 1);
                 for (i = 0; i < 6; i++) {
                     count[0][i] = put_bits_count(&s->reorder_pb[i]);
                     flush_put_bits(&s->reorder_pb[i]);

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

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

Reply via email to