* Add fix for overflow in kind=light mgl_example

This commit is contained in:
D Haley 2018-02-16 00:49:05 +00:00
parent 8502ab82d8
commit 50e60e4989
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff -r b759fc50f42e src/pixel.cpp
--- a/src/pixel.cpp Fri Feb 16 00:41:32 2018 +0000
+++ b/src/pixel.cpp Fri Feb 16 00:42:35 2018 +0000
@@ -274,7 +274,7 @@
// if(!r) return r; // NOTE r must be provided!
if(p.a<=0) { memset(r,0,4); return r; }
float b0=0,b1=0,b2=0, ar,ag,ab,dif;
- const size_t nl = p.sub>=0?p.sub:1-p.sub;
+ const size_t nl = p.sub>=0?p.sub:-1-p.sub;
const bool glob = !get(MGL_LOCAL_LIGHT);
ar = ag = ab = glob?AmbBr:Sub[nl].AmbBr;
dif = glob?DifBr:Sub[nl].DifBr;

View File

@ -19,7 +19,7 @@
Name: mathgl
Version: 2.4.1
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Cross-platform library for making high-quality scientific graphics
Summary(de): Plattformübergreifende Bibliothek für hochwertige wissenschaftliche Graphiken
Summary(ru): Библиотека для осуществления высококачественной визуализации данных
@ -52,6 +52,9 @@ Patch6: mathgl-2.4.1-gcc7.patch
# Disable uppdate-{destop,mine}-database during install process
Patch7: mathgl-2.4.1-no_updatedb.patch
# Fix overflow (mathgl mailing list, 14/2/18. Fixed upstream
Patch8: mathgl-2.4.1-fix_overflow.patch
Requires: %{name}-common = %{version}-%{release}
# mandatory packages
@ -365,6 +368,7 @@ done
%patch5 -p1 -b .lang
%patch6 -p1 -b .gcc7
%patch7 -p1 -b .no_updatedb
%patch8 -p1 -b .fix_overflow
%if 0%{?with_octave}
%patch3 -p1 -b .nooctaveinstall
%else
@ -681,6 +685,9 @@ fi
%endif
%changelog
* Fri Feb 16 2018 D Haley <mycae gmx com> - 2.4.1-4
- Fix overflow in mgl_example (light)
* Tue Feb 13 2018 Sandro Mani <manisandro@gmail.com> - 2.4.1-3
- Rebuild (giflib)