Commit 41fc098a authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer
Browse files

libopenmpt: add missing avio_read return value check


This fixes heap-buffer-overflows in libopenmpt caused by interpreting
the negative size value as unsigned size_t.
Signed-off-by: default avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: default avatarJörn Heusipp <osmanx@problemloesungsmaschine.de>
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 367cac78

)
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
Showing with 5 additions and 0 deletions
+5 -0
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment