From 02ecf8d7f3fe6ad6bc493a37bfff65bfe9150113 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sat, 25 May 2024 20:32:42 +0200 Subject: [PATCH] avcodec/vc2enc: Fix slice length args->bytes here already includes prefix_bytes (see SSIZE_ROUND macro), so including it here again and forgetting it when offsetting skip seems wrong. This only works because prefix_bytes is currently always zero in this encoder. (This has been added in b88be742fac7a77a8095e8155ba8790db4b77568 without any reason.) Reviewed-by: Lynne Signed-off-by: Andreas Rheinhardt --- libavcodec/vc2enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c index f39f368181..3285218724 100644 --- a/libavcodec/vc2enc.c +++ b/libavcodec/vc2enc.c @@ -788,7 +788,7 @@ static int encode_slices(VC2EncContext *s) for (slice_y = 0; slice_y < s->num_y; slice_y++) { for (slice_x = 0; slice_x < s->num_x; slice_x++) { SliceArgs *args = &enc_args[s->num_x*slice_y + slice_x]; - init_put_bits(&args->pb, buf + skip, args->bytes+s->prefix_bytes); + init_put_bits(&args->pb, buf + skip, args->bytes); skip += args->bytes; } }