Add patch to fix potential crash on startup

Raster::resize() was being called with a negative width or height due to
bad state being stored in the config.  This resulted in fldigi crashing
before the UI was displayed.  This patch works around the problem and has
been submitted upstream.
This commit is contained in:
Stephen Hurd 2018-08-11 23:32:35 +00:00
parent 11818b9043
commit bdfc42b73f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=476948
2 changed files with 14 additions and 1 deletions

View file

@ -2,7 +2,7 @@
PORTNAME= fldigi
PORTVERSION= 4.0.17
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= comms hamradio
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}

View file

@ -0,0 +1,13 @@
--- src/waterfall/raster.cxx.orig 2018-08-11 23:26:43 UTC
+++ src/waterfall/raster.cxx
@@ -169,6 +169,10 @@ void Raster::resize(int x, int y, int w,
while ((Ndest * rhs) < Hdest) Ndest++;
Ndest--;
+ if (Wdest < 0)
+ Wdest = 0;
+ if (Hdest < 0)
+ Hdest = 0;
unsigned char *tempbuf = new unsigned char [Wdest * Hdest];
unsigned char *oldbuf = vidbuf;