X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Flibopenmpt.c;h=35fd28f5f4d36ff067db882c5f73b2a576f5c5a4;hb=2b9f92fcc5486361b63c4fab5a24c222dc8969ef;hp=e7091ef9fc5f748463ebb1553108fbfe31902423;hpb=68b0d7e0be66bfa8141f8bd3eaa004b8104b8c34;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);