blob: 4e807c87b519745309f67c8f4aba962934532548 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
$NetBSD: patch-ca,v 1.1 2009/08/05 20:58:56 drochner Exp $
--- src/common/image.cpp.orig 2009-03-06 13:17:40.000000000 +0100
+++ src/common/image.cpp
@@ -186,6 +186,10 @@ bool wxImage::Create( int width, int hei
m_refData = new wxImageRefData();
+ if (width <= 0 || height <= 0 || width > INT_MAX / 3 / height) {
+ UnRef();
+ return false;
+ }
M_IMGDATA->m_data = (unsigned char *) malloc( width*height*3 );
if (!M_IMGDATA->m_data)
{
|