diff options
Diffstat (limited to 'libavcodec/g2meet.c')
-rw-r--r-- | libavcodec/g2meet.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index b409dae813..5edfb31560 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -1356,14 +1356,16 @@ static void g2m_paint_cursor(G2MContext *c, uint8_t *dst, int stride) } else { dst += x * 3; } - if (y < 0) { + + if (y < 0) h += y; + if (w < 0 || h < 0) + return; + if (y < 0) { cursor += -y * c->cursor_stride; } else { dst += y * stride; } - if (w < 0 || h < 0) - return; for (j = 0; j < h; j++) { for (i = 0; i < w; i++) { |