From 1614e03cdb756e35b75b86c41397407558ed5fdf Mon Sep 17 00:00:00 2001 From: Zaheer Abbas Merali Date: Thu, 29 Jun 2006 11:05:14 +0000 Subject: [PATCH] sys/ximage/gstximagesrc.c: Fix hypothetical crash. Original commit message from CVS: 2006-06-29 Zaheer Abbas Merali * sys/ximage/gstximagesrc.c: (gst_ximage_src_ximage_get): Fix hypothetical crash. --- ChangeLog | 6 ++++++ sys/ximage/gstximagesrc.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5dfd1442e2..37c752d409 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-06-29 Zaheer Abbas Merali + + * sys/ximage/gstximagesrc.c: (gst_ximage_src_ximage_get): + + Fix hypothetical crash. + 2006-06-28 Tim-Philipp Müller Patch by: Brian Cameron diff --git a/sys/ximage/gstximagesrc.c b/sys/ximage/gstximagesrc.c index 55e1834d8f..e8ac729348 100644 --- a/sys/ximage/gstximagesrc.c +++ b/sys/ximage/gstximagesrc.c @@ -479,7 +479,11 @@ gst_ximage_src_ximage_get (GstXImageSrc * ximagesrc) int cx, cy, i, j, count; cx = ximagesrc->cursor_image->x - ximagesrc->cursor_image->xhot; + if (cx < 0) + cx = 0; cy = ximagesrc->cursor_image->y - ximagesrc->cursor_image->yhot; + if (cy < 0) + cy = 0; count = ximagesrc->cursor_image->width * ximagesrc->cursor_image->height; for (i = 0; i < count; i++) ximagesrc->cursor_image->pixels[i] =