X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Flibopenmpt.c;h=35fd28f5f4d36ff067db882c5f73b2a576f5c5a4;hb=4e3cc4bdd8acedbcc703607ed0efbb64bb5c3cc4;hp=e7091ef9fc5f748463ebb1553108fbfe31902423;hpb=2f1a539d4b905a418aec4b420adcb7648eba5c64;p=ffmpeg diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c index e7091ef9fc5..35fd28f5f4d 100644 --- a/libavformat/libopenmpt.c +++ b/libavformat/libopenmpt.c @@ -82,6 +82,11 @@ static int read_header_openmpt(AVFormatContext *s) if (!buf) return AVERROR(ENOMEM); size = avio_read(s->pb, buf, size); + if (size < 0) { + av_log(s, AV_LOG_ERROR, "Reading input buffer failed.\n"); + av_freep(&buf); + return size; + } openmpt->module = openmpt_module_create_from_memory(buf, size, openmpt_logfunc, s, NULL); av_freep(&buf);