diff mbox series

[FFmpeg-devel] fftools/ffmpeg: Zero subtitle packet padding

Message ID DB6PR0101MB2214FBFB2A00BB7F4820F6508F939@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com
State Accepted
Commit b0ae5d02f3664545e54c8ce0101037619c4fa7e6
Headers show
Series [FFmpeg-devel] fftools/ffmpeg: Zero subtitle packet padding | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt July 23, 2022, 4:35 p.m. UTC
Fixes uninitialized reads in the sub-lrc-remux test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 632ac25cb2..1089cc48c4 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1118,7 +1118,7 @@  static void do_subtitle_out(OutputFile *of,
             exit_program(1);
         }
 
-        pkt->size = subtitle_out_size;
+        av_shrink_packet(pkt, subtitle_out_size);
         pkt->pts  = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ost->mux_timebase);
         pkt->duration = av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, ost->mux_timebase);
         if (enc->codec_id == AV_CODEC_ID_DVB_SUBTITLE) {