[Rawstudio-commit] r3156 - trunk/plugins/dcp

Anders Kvist anders at kvistmail.dk
Wed Feb 3 18:56:05 CET 2010


Author: akv
Date: 2010-02-03 18:56:05 +0100 (Wed, 03 Feb 2010)
New Revision: 3156

Modified:
   trunk/plugins/dcp/dcp.c
Log:
Fixed problem when curves have two points - low knot were always 0,0 because of free before usage. Moved freeing to after usage.

Modified: trunk/plugins/dcp/dcp.c
===================================================================
--- trunk/plugins/dcp/dcp.c	2010-02-02 20:01:45 UTC (rev 3155)
+++ trunk/plugins/dcp/dcp.c	2010-02-03 17:56:05 UTC (rev 3156)
@@ -186,13 +186,14 @@
 				RSSpline *spline = rs_spline_new(knots, dcp->nknots, NATURAL);
 				rs_spline_sample(spline, dcp->curve_samples, 65536);
 				g_object_unref(spline);
-				g_free(knots);
 			}
 			dcp->curve_is_flat = FALSE;
 			if (nknots == 2)
 				if (ABS(knots[0]) < 0.0001 && ABS(knots[1]) < 0.0001)
 					if (ABS(1.0 - knots[2]) < 0.0001 && ABS(1.0 - knots[3]) < 0.0001)
 						dcp->curve_is_flat = TRUE;
+			if (knots)
+				g_free(knots);
 		}
 		else
 			dcp->curve_is_flat = TRUE;




More information about the Rawstudio-commit mailing list