diff mbox series

[FFmpeg-devel,13/18] avformat/ipmovie: Avoid stack packet

Message ID 20210319055904.2264501-13-andreas.rheinhardt@gmail.com
State Accepted
Commit 0519a32a6458c41997b4d7bd8604afe0f354b1cc
Headers show
Series [FFmpeg-devel,01/18] libavformat/utils: Fix indentation
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt March 19, 2021, 5:58 a.m. UTC
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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 048e748cfd..9118d7d807 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -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;
     }