This fixes heap-buffer-overflows in libopenmpt caused by interpreting the negative size value as unsigned size_t.
Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> --- libavformat/libopenmpt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c index e7091ef9fc..35fd28f5f4 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); -- 2.11.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel