Update of /cvsroot/ufraw/ufraw
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24511
Modified Files:
ufraw_ufraw.c
Log Message:
Check for overflows in ufraw_scale_raw(). Apparently the assumptions that
there will be no overflow was wrong, at least for Foveon raw files.
Index: ufraw_ufraw.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_ufraw.c,v
retrieving revision 1.224
retrieving revision 1.225
diff -u -d -r1.224 -r1.225
--- ufraw_ufraw.c 1 Dec 2009 05:40:58 -0000 1.224
+++ ufraw_ufraw.c 5 Dec 2009 02:38:05 -0000 1.225
@@ -585,11 +585,12 @@
if (scale) {
end = (guint16 *)(raw->raw.image + raw->raw.width * raw->raw.height);
/* OpenMP overhead appears to be too large in this case */
- /* We are assuming here that there will be no overflow since all
- * pixel values should be below rgbMax. dcraw's wavelet_denoise()
- * makes the same assumption, so it seems like a safe bet. */
+ int max = 0x10000 >> scale;
for (p = (guint16 *)raw->raw.image; p < end; ++p)
- *p <<= scale;
+ if (*p < max)
+ *p <<= scale;
+ else
+ *p = 0xffff;
raw->black <<= scale;
}
return 1 << scale;
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
ufraw-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-cvs