gimp r25186 - in trunk: . plug-ins/common
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25186 - in trunk: . plug-ins/common
- Date: Sun, 23 Mar 2008 23:16:50 +0000 (GMT)
Author: neo
Date: Sun Mar 23 23:16:50 2008
New Revision: 25186
URL: http://svn.gnome.org/viewvc/gimp?rev=25186&view=rev
Log:
2008-03-24 Sven Neumann <sven gimp org>
* plug-ins/common/dicom.c (dicom_loader): fixed potential crash
on
empty 16 bit images.
Modified:
trunk/ChangeLog
trunk/plug-ins/common/dicom.c
Modified: trunk/plug-ins/common/dicom.c
==============================================================================
--- trunk/plug-ins/common/dicom.c (original)
+++ trunk/plug-ins/common/dicom.c Sun Mar 23 23:16:50 2008
@@ -544,13 +544,12 @@
gint samples_per_pixel = info->samples_per_pixel;
guint16 *buf16 = (guint16 *) pix_buffer;
gint pix_idx;
- guint16 max = 0;
+ guint16 max = 1;
if (info->bpp == 16)
{
/* Reorder the buffer and look for max */
- max = 0;
- for (pix_idx=0; pix_idx < width * height * samples_per_pixel; pix_idx++)
+ for (pix_idx = 0; pix_idx < width * height * samples_per_pixel; pix_idx++)
{
guint pix_gl = g_ntohs (GUINT16_SWAP_LE_BE (buf16[pix_idx]));
@@ -582,7 +581,7 @@
for (col_idx = 0; col_idx < width * samples_per_pixel; col_idx++)
d[col_idx] =
- (guint8) (255.0 * (gdouble)(row_start[col_idx]) / max);
+ (guint8) (255.999 * (gdouble) (row_start[col_idx]) / max);
}
else if (info->bpp == 8)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]