]> git.sesse.net Git - ffmpeg/commitdiff
avformat/ipmovie: Avoid stack packet
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 18 Mar 2021 20:35:58 +0000 (21:35 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 23 Mar 2021 23:26:45 +0000 (00:26 +0100)
Replace it in ipmovie_read_header() by AVFormatInternal.parse_pkt
which is unused when reading the header.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/ipmovie.c

index 048e748cfd55366a5f26275d36a17044c2ce1799..9118d7d807bfb5e02be5f7c9cb27ebcb37499d49 100644 (file)
@@ -608,7 +608,6 @@ static int ipmovie_read_header(AVFormatContext *s)
 {
     IPMVEContext *ipmovie = s->priv_data;
     AVIOContext *pb = s->pb;
-    AVPacket pkt;
     AVStream *st;
     unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
     int chunk_type, i;
@@ -645,8 +644,7 @@ static int ipmovie_read_header(AVFormatContext *s)
 
     if (chunk_type == CHUNK_VIDEO)
         ipmovie->audio_type = AV_CODEC_ID_NONE;  /* no audio */
-    else if (process_ipmovie_chunk(ipmovie, pb, &pkt) != CHUNK_INIT_AUDIO) {
-        av_packet_unref(&pkt);
+    else if (process_ipmovie_chunk(ipmovie, pb, s->internal->parse_pkt) != CHUNK_INIT_AUDIO) {
         return AVERROR_INVALIDDATA;
     }