]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/thp.c
avcodec/anm: Don't unnecessarily use context variables
[ffmpeg] / libavformat / thp.c
index 76b9b3820ce8cd7398af125d4304d5b3a2e3c3d5..d3ae86c645167c6419d9760063df29dee0eeade0 100644 (file)
@@ -45,7 +45,7 @@ typedef struct ThpDemuxContext {
 } ThpDemuxContext;
 
 
-static int thp_probe(AVProbeData *p)
+static int thp_probe(const AVProbeData *p)
 {
     double d;
     /* check file header */
@@ -145,6 +145,9 @@ static int thp_read_header(AVFormatContext *s)
         }
     }
 
+    if (!thp->vst)
+        return AVERROR_INVALIDDATA;
+
     return 0;
 }
 
@@ -181,7 +184,6 @@ static int thp_read_packet(AVFormatContext *s,
         if (ret < 0)
             return ret;
         if (ret != size) {
-            av_packet_unref(pkt);
             return AVERROR(EIO);
         }
 
@@ -191,7 +193,6 @@ static int thp_read_packet(AVFormatContext *s,
         if (ret < 0)
             return ret;
         if (ret != thp->audiosize) {
-            av_packet_unref(pkt);
             return AVERROR(EIO);
         }