[FFmpeg-cvslog] avcodec/vc2enc: Fix slice length

Andreas Rheinhardt git at videolan.org
Fri May 31 15:30:10 EEST 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat May 25 20:32:42 2024 +0200| [02ecf8d7f3fe6ad6bc493a37bfff65bfe9150113] | committer: Andreas Rheinhardt

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 <dev at lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 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;
         }
     }



More information about the ffmpeg-cvslog mailing list