From 4b54469109031ea5017491f3c1e96d439ad58eac Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 17 Mar 2025 10:10:32 +0100 Subject: [PATCH 3/3] 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@outlook.com> --- 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]); -- 2.45.2