Commit 3c4c5ca1 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/g2meet: Check monochrome cursor width

Fixes out of array write

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 69e4d8e6
......@@ -514,6 +514,11 @@ static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
return AVERROR_PATCHWELCOME;
}
if (cursor_fmt == 1 && cursor_w % 32) {
avpriv_report_missing_feature(avctx, "odd monochrome cursor width %d", cursor_w);
return AVERROR_PATCHWELCOME;
}
tmp = av_realloc(c->cursor, cursor_stride * cursor_h);
if (!tmp) {
av_log(avctx, AV_LOG_ERROR, "Cannot allocate cursor buffer\n");
......
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