summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2023-07-03 13:40:23 +0200
committerDave Davenport <qball@blame.services>2023-07-03 13:40:23 +0200
commitbe6db24667900bf45154242aee25ab95e7eb8ec3 (patch)
tree4716da4d339a3029a63ed623dda6383323705968
parent628d0b272c2a0614bf6796fc9f478a2a4a3ac304 (diff)
[window] Quick test of code scanning.
-rw-r--r--source/modes/window.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/modes/window.c b/source/modes/window.c
index 91ad3fc7..1d93e957 100644
--- a/source/modes/window.c
+++ b/source/modes/window.c
@@ -968,10 +968,14 @@ static cairo_user_data_key_t data_key;
* \param data The image's data in ARGB format, will be copied by this
* function.
*/
-static cairo_surface_t *draw_surface_from_data(int width, int height,
+static cairo_surface_t *draw_surface_from_data(uint32_t width, uint32_t height,
uint32_t const *const data) {
- unsigned long int len = width * height;
- unsigned long int i;
+ // limit surface size.
+ if ( width >= 65536 || height >= 65536){
+ return NULL;
+ }
+ uint32_t len = width * height;
+ uint32_t i;
uint32_t *buffer = g_new0(uint32_t, len);
cairo_surface_t *surface;