]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/ipmovie.c
cmdutils: replace strncpy() with direct assignment
[ffmpeg] / libavformat / ipmovie.c
index 7f5a8c62ef69bb79a0e268c3bc47082c4fb407fa..3234d591da187dd7ba2c22bf63dc5366e7cf5df7 100644 (file)
@@ -614,7 +614,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
 
 static const char signature[] = "Interplay MVE File\x1A\0\x1A";
 
-static int ipmovie_probe(AVProbeData *p)
+static int ipmovie_probe(const AVProbeData *p)
 {
     const uint8_t *b = p->buf;
     const uint8_t *b_end = p->buf + p->buf_size - sizeof(signature);
@@ -661,8 +661,10 @@ static int ipmovie_read_header(AVFormatContext *s)
         ipmovie->palette[i] = 0xFFU << 24;
 
     /* process the first chunk which should be CHUNK_INIT_VIDEO */
-    if (process_ipmovie_chunk(ipmovie, pb, &pkt) != CHUNK_INIT_VIDEO)
+    if (process_ipmovie_chunk(ipmovie, pb, &pkt) != CHUNK_INIT_VIDEO) {
+        av_packet_unref(&pkt);
         return AVERROR_INVALIDDATA;
+    }
 
     /* peek ahead to the next chunk-- if it is an init audio chunk, process
      * it; if it is the first video chunk, this is a silent file */
@@ -674,8 +676,10 @@ 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)
+    else if (process_ipmovie_chunk(ipmovie, pb, &pkt) != CHUNK_INIT_AUDIO) {
+        av_packet_unref(&pkt);
         return AVERROR_INVALIDDATA;
+    }
 
     /* initialize the stream decoders */
     st = avformat_new_stream(s, NULL);