avformat/libopenmpt: Check for avio_size() failure
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 30 Mar 2017 20:55:28 +0000 (22:55 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 30 Mar 2017 21:35:18 +0000 (23:35 +0200)
Fixes CID1396850

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/libopenmpt.c

index 35fd28f..a7e3859 100644 (file)
@@ -73,7 +73,7 @@ static int read_header_openmpt(AVFormatContext *s)
     AVStream *st;
     OpenMPTContext *openmpt = s->priv_data;
     int64_t size = avio_size(s->pb);
-    if (!size)
+    if (size <= 0)
         return AVERROR_INVALIDDATA;
     char *buf = av_malloc(size);
     int ret;