diff --git a/ffmpeg.c b/ffmpeg.c index b82d2be398..60b10cce5b 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -627,6 +627,8 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost) a = AVERROR(ENOMEM); } if (a > 0) { + pkt->side_data = NULL; + pkt->side_data_elems = 0; av_free_packet(pkt); new_pkt.buf = av_buffer_create(new_pkt.data, new_pkt.size, av_buffer_default_free, NULL, 0);