[FFmpeg-cvslog] avcodec/svq1enc: Don't add to NULL
Andreas Rheinhardt
git at videolan.org
Thu Mar 20 09:10:12 EET 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at 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.rheinhardt at 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]);
More information about the ffmpeg-cvslog
mailing list