]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/vc2enc: Actually zero padding
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Mon, 26 Apr 2021 16:16:24 +0000 (18:16 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Mon, 26 Apr 2021 18:07:21 +0000 (20:07 +0200)
This encoder sets the min_size in ff_alloc_packet2(), so it can not rely
on av_packet_make_refcounted() to zero the padding.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavcodec/vc2enc.c

index 7bd2e4c2abac3ec29177497cb5d3db98785b2032..6c2e873a2338e9608715d99a676dcddd2d2e586e 100644 (file)
@@ -993,7 +993,7 @@ static av_cold int vc2_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     }
 
     flush_put_bits(&s->pb);
-    avpkt->size = put_bits_count(&s->pb) >> 3;
+    av_shrink_packet(avpkt, put_bytes_output(&s->pb));
 
     *got_packet = 1;