X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fthp.c;h=d3ae86c645167c6419d9760063df29dee0eeade0;hb=a8867850185a14e580dfeed2b39e8aae5e306e7c;hp=76b9b3820ce8cd7398af125d4304d5b3a2e3c3d5;hpb=44085b9951b06df1cab4105dcda004213988d84f;p=ffmpeg diff --git a/libavformat/thp.c b/libavformat/thp.c index 76b9b3820ce..d3ae86c6451 100644 --- a/libavformat/thp.c +++ b/libavformat/thp.c @@ -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); }