]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/yop.c
mp3dec: fix reading the Xing tag
[ffmpeg] / libavformat / yop.c
index 5fe6bdc7d473d9c53b0331c6dd38df1ec66a5459..ea3175e33b07c14c13620b065da28e7a0810a87a 100644 (file)
@@ -62,13 +62,12 @@ static int yop_read_header(AVFormatContext *s)
     video_stream = avformat_new_stream(s, NULL);
 
     // Extra data that will be passed to the decoder
-    video_stream->codec->extradata_size = 8;
 
-    video_stream->codec->extradata = av_mallocz(video_stream->codec->extradata_size +
-                                                FF_INPUT_BUFFER_PADDING_SIZE);
+    video_stream->codec->extradata = av_mallocz(8 + FF_INPUT_BUFFER_PADDING_SIZE);
 
     if (!video_stream->codec->extradata)
         return AVERROR(ENOMEM);
+    video_stream->codec->extradata_size = 8;
 
     // Audio
     audio_dec               = audio_stream->codec;
@@ -127,6 +126,12 @@ static int yop_read_packet(AVFormatContext *s, AVPacket *pkt)
     if (yop->video_packet.data) {
         *pkt                   =  yop->video_packet;
         yop->video_packet.data =  NULL;
+        yop->video_packet.buf  =  NULL;
+#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
+        yop->video_packet.destruct = NULL;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         yop->video_packet.size =  0;
         pkt->data[0]           =  yop->odd_frame;
         pkt->flags             |= AV_PKT_FLAG_KEY;