avconv: Always initialize the opkt struct on streamcopy

This commit is contained in:
Luca Barbato 2017-05-29 13:55:28 +02:00
parent 427f7a1f9e
commit 91622f6446

View File

@ -1125,7 +1125,9 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
InputFile *f = input_files [ist->file_index]; InputFile *f = input_files [ist->file_index];
int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time; 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); 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. // EOF: flush output bitstream filters.
if (!pkt) { if (!pkt) {
@ -1133,8 +1135,6 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
return; return;
} }
av_init_packet(&opkt);
if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) && if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&
!ost->copy_initial_nonkeyframes) !ost->copy_initial_nonkeyframes)
return; return;