1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

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>
This commit is contained in:
Andreas Rheinhardt
2025-03-17 10:10:32 +01:00
parent 02c16b48c5
commit d76ae08048

View File

@ -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); put_bits(&s->reorder_pb[5], SVQ1_BLOCK_INTRA_LEN, SVQ1_BLOCK_INTRA_CODE);
score[0] = SVQ1_BLOCK_INTRA_LEN * lambda; score[0] = SVQ1_BLOCK_INTRA_LEN * lambda;
} }
score[0] += encode_block(s, src + 16 * x, NULL, temp, stride, score[0] += encode_block(s, src + 16 * x, src + 16 * x /* unused */,
5, 64, lambda, 1); temp, stride, 5, 64, lambda, 1);
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
count[0][i] = put_bits_count(&s->reorder_pb[i]); count[0][i] = put_bits_count(&s->reorder_pb[i]);
flush_put_bits(&s->reorder_pb[i]); flush_put_bits(&s->reorder_pb[i]);