Revision: 2152
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2152&view=rev
Author: teuf
Date: 2008-11-17 19:56:28 +0000 (Mon, 17 Nov 2008)
Log Message:
-----------
Stricter sanity check
Modified Paths:
--------------
libgpod/trunk/ChangeLog
libgpod/trunk/src/ithumb-writer.c
Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog 2008-11-17 19:56:12 UTC (rev 2151)
+++ libgpod/trunk/ChangeLog 2008-11-17 19:56:28 UTC (rev 2152)
@@ -1,5 +1,9 @@
2008-11-17 Christophe Fergeau <[EMAIL PROTECTED]>
+ * src/ithumb-writer.c: stricter sanity check
+
+2008-11-17 Christophe Fergeau <[EMAIL PROTECTED]>
+
* src/ithumb-writer.c: add checks for int overflows on malloc args
2008-11-14 Todd Zullinger <tmzullinger at users.sourceforge.net>
Modified: libgpod/trunk/src/ithumb-writer.c
===================================================================
--- libgpod/trunk/src/ithumb-writer.c 2008-11-17 19:56:12 UTC (rev 2151)
+++ libgpod/trunk/src/ithumb-writer.c 2008-11-17 19:56:28 UTC (rev 2152)
@@ -107,7 +107,8 @@
"rowstride", &row_stride, "n-channels", &channels,
"height", &height, "width", &width,
"pixels", &pixels, NULL);
- g_return_val_if_fail ((width <= img_info->width) && (height <=
img_info->height), NULL);
+ g_return_val_if_fail (((width + horizontal_padding) <=
img_info->width), NULL);
+ g_return_val_if_fail (((height + vertical_padding) <=
img_info->height), NULL);
if ((img_info->align_row_bytes) && ((img_info->width % 2) != 0)) {
/* each pixel is 2 bytes, to align rows on 4 bytes boundaries,
@@ -214,7 +215,8 @@
"rowstride", &row_stride, "n-channels", &channels,
"height", &height, "width", &width,
"pixels", &pixels, NULL);
- g_return_val_if_fail ((width <= img_info->width) && (height <=
img_info->height), NULL);
+ g_return_val_if_fail (((width + horizontal_padding) <=
img_info->width), NULL);
+ g_return_val_if_fail (((height + vertical_padding) <=
img_info->height), NULL);
if ((img_info->align_row_bytes) && ((img_info->width % 2) != 0)) {
/* each pixel is 2 bytes, to align rows on 4 bytes boundaries,
@@ -320,6 +322,8 @@
"rowstride", &row_stride, "n-channels", &channels,
"height", &height, "width", &width,
"pixels", &pixels, NULL);
+ g_return_val_if_fail (((width + horizontal_padding) <=
img_info->width), NULL);
+ g_return_val_if_fail (((height + vertical_padding) <=
img_info->height), NULL);
g_return_val_if_fail ((width <= img_info->width) && (height <=
img_info->height), NULL);
/* Make sure thumb size calculation won't overflow */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2