]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/thp.c
avcodec/anm: Don't unnecessarily use context variables
[ffmpeg] / libavformat / thp.c
index ee5c78b6d3cab16870d6146ca61389ef8ce1e771..d3ae86c645167c6419d9760063df29dee0eeade0 100644 (file)
@@ -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);
         }