[FFmpeg-cvslog] avconv: Always initialize the opkt struct on streamcopy

Luca Barbato git at videolan.org
Tue Oct 31 19:01:17 EET 2017


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Mon May 29 13:55:28 2017 +0200| [91622f6446b463abe6507ad2cd5d1fbf7e49c424] | committer: Luca Barbato

avconv: Always initialize the opkt struct on streamcopy

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

 avtools/avconv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/avtools/avconv.c b/avtools/avconv.c
index 719d289ff9..8dd11bb5fc 100644
--- a/avtools/avconv.c
+++ b/avtools/avconv.c
@@ -1125,7 +1125,9 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
     InputFile   *f = input_files [ist->file_index];
     int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time;
     int64_t ost_tb_start_time = av_rescale_q(start_time, AV_TIME_BASE_Q, ost->mux_timebase);
-    AVPacket opkt;
+    AVPacket opkt = { 0 };
+
+    av_init_packet(&opkt);
 
     // EOF: flush output bitstream filters.
     if (!pkt) {
@@ -1133,8 +1135,6 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
         return;
     }
 
-    av_init_packet(&opkt);
-
     if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&
         !ost->copy_initial_nonkeyframes)
         return;



More information about the ffmpeg-cvslog mailing list