[SCM] plotmm/master: Add patch to fix curve display which gets wrong due to integer overflow when zooming in.

alessio at users.alioth.debian.org alessio at users.alioth.debian.org
Fri Oct 22 16:38:16 UTC 2010


The following commit has been merged in the master branch:
commit f9ca949c5dbe84564feb5360975c6cc3e83d1001
Author: Alessio Treglia <alessio at debian.org>
Date:   Fri Oct 22 18:37:47 2010 +0200

    Add patch to fix curve display which gets wrong due to integer overflow when zooming in.

diff --git a/debian/patches/04-integer_overflow.patch b/debian/patches/04-integer_overflow.patch
new file mode 100644
index 0000000..8d72986
--- /dev/null
+++ b/debian/patches/04-integer_overflow.patch
@@ -0,0 +1,33 @@
+Subject: Avoid integer wrap around when zooming in.
+Bug: http://sourceforge.net/support/tracker.php?aid=1720945
+Origin: http://sourceforge.net/support/tracker.php?aid=1720945
+Applied-Upstream: no
+---
+ plotmm/doubleintmap.h |    9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+--- plotmm.orig/plotmm/doubleintmap.h
++++ plotmm/plotmm/doubleintmap.h
+@@ -11,6 +11,7 @@
+ #define PLOTMM_DBLINTMAP_H
+ 
+ #include <plotmm/supplemental.h>
++#include <limits.h>
+ 
+ namespace PlotMM {
+ 
+@@ -143,10 +144,10 @@ namespace PlotMM {
+      */
+     inline int DoubleIntMap::transform(double x) const
+     {
+-	if (d_log)
+-	    return d_y1 + ROUND((log(x) - d_x1) * d_cnv);
+-	else
+-	    return d_y1 + ROUND((x - d_x1) * d_cnv);
++	double y(((d_log ? log(x) : x)  - d_x1) * d_cnv);
++	y = std::min(std::numeric_limits<short>::max() - (double)d_y1,
++		     std::max(std::numeric_limits<short>::min() - (double)d_y1, y));
++	return d_y1 + ROUND(y);
+     }
+ 
+ }
diff --git a/debian/patches/series b/debian/patches/series
index c89dc0c..9e88772 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 01-declaring_SigC_error.patch
 02-buildsystem.patch
 03-pkgconfig.patch
+04-integer_overflow.patch

-- 
plotmm packaging



More information about the pkg-multimedia-commits mailing list