- update to 2.1.0 (post RC2 git snapshot)
This commit is contained in:
parent
3b3b1f1ef2
commit
5a51fe9ae7
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
gd-2.0.35.tar.bz2
|
||||
/libgd-2.1.0-725ba9de4005144d137d2a7a70f760068fc3d306.tgz
|
||||
|
@ -1,22 +0,0 @@
|
||||
--- gd-2.0.33/gdft.c.pom 2004-11-02 22:00:48.000000000 +0100
|
||||
+++ gd-2.0.33/gdft.c 2006-11-21 09:25:49.000000000 +0100
|
||||
@@ -1237,7 +1237,8 @@
|
||||
glyph_min.x = penf.x + slot->metrics.horiBearingX;
|
||||
glyph_min.y = penf.y - slot->metrics.horiBearingY;
|
||||
|
||||
-#if 0
|
||||
+// #if 0 - this version of glyph_max.x setting fixes problem with
|
||||
+// too large bouonding box
|
||||
if (ch == ' ') /* special case for trailing space */
|
||||
{
|
||||
glyph_max.x = penf.x + horiAdvance;
|
||||
@@ -1246,7 +1247,8 @@
|
||||
{
|
||||
glyph_max.x = glyph_min.x + slot->metrics.width;
|
||||
}
|
||||
-#else
|
||||
+//#else
|
||||
+#if 0
|
||||
glyph_max.x = penf.x + horiAdvance;
|
||||
#endif
|
||||
glyph_max.y = glyph_min.y + slot->metrics.height;
|
@ -1,113 +0,0 @@
|
||||
--- /dev/null 2007-09-04 12:46:47.564263777 +0200
|
||||
+++ gd-2.0.34/config/gdlib.pc.in 2007-09-04 15:17:09.000000000 +0200
|
||||
@@ -0,0 +1,15 @@
|
||||
+prefix=@prefix@
|
||||
+exec_prefix=@exec_prefix@
|
||||
+libdir=@libdir@
|
||||
+includedir=@includedir@
|
||||
+bindir=@bindir@
|
||||
+ldflags=@LDFLAGS@
|
||||
+
|
||||
+
|
||||
+Name: gd-devel
|
||||
+Description: A graphics library for quick creation of PNG or JPEG images
|
||||
+Version: @VERSION@
|
||||
+Requires:
|
||||
+Libs: -L${libdir} -lgd
|
||||
+Libs.private: @LIBS@
|
||||
+Cflags: -I${includedir}
|
||||
--- gd-2.0.34/Makefile.in.pom 2007-02-03 02:41:46.000000000 +0100
|
||||
+++ gd-2.0.34/Makefile.in 2007-02-08 13:34:06.000000000 +0100
|
||||
@@ -341,6 +341,7 @@
|
||||
ACLOCAL_AMFLAGS = -I config
|
||||
SUBDIRS = config test
|
||||
bin_SCRIPTS = bdftogd config/gdlib-config
|
||||
+pkgconf_CFILE = config/gdlib.pc
|
||||
EXTRA_DIST = README-JPEG.TXT README.TXT configure.pl bdftogd demoin.png err.out index.html install-item makefile.sample readme.jpn entities.html entities.tcl
|
||||
include_HEADERS = gd.h gdfx.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h entities.h
|
||||
lib_LTLIBRARIES = libgd.la
|
||||
@@ -553,6 +554,15 @@
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
+install-pkgconfigCF:
|
||||
+ $(mkdir_p) "$(DESTDIR)$(libdir)/pkgconfig"
|
||||
+ echo " cp $(pkgconf_CFILE) $(DESTDIR)$(libdir)/pkgconfig/gdlib.pc"
|
||||
+ cp $(pkgconf_CFILE) $(DESTDIR)$(libdir)/pkgconfig/gdlib.pc
|
||||
+
|
||||
+uninstall-pkgconfigCF:
|
||||
+ echo " rm $(DESTDIR)$(libdir)/pkgconfig/gdlib.pc"
|
||||
+ rm $(DESTDIR)$(libdir)/pkgconfig/gdlib.pc
|
||||
+
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
@@ -986,7 +996,7 @@
|
||||
|
||||
install-data-am: install-includeHEADERS
|
||||
|
||||
-install-exec-am: install-binPROGRAMS install-binSCRIPTS \
|
||||
+install-exec-am: install-binPROGRAMS install-binSCRIPTS install-pkgconfigCF\
|
||||
install-libLTLIBRARIES
|
||||
|
||||
install-info: install-info-recursive
|
||||
@@ -1015,7 +1025,7 @@
|
||||
|
||||
ps-am:
|
||||
|
||||
-uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
|
||||
+uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-pkgconfigCF\
|
||||
uninstall-includeHEADERS uninstall-info-am \
|
||||
uninstall-libLTLIBRARIES
|
||||
|
||||
--- gd-2.0.34/config/gdlib-config.in.pom 2007-02-03 02:41:00.000000000 +0100
|
||||
+++ gd-2.0.34/config/gdlib-config.in 2007-02-08 13:27:25.000000000 +0100
|
||||
@@ -7,9 +7,10 @@
|
||||
# installation directories
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
-libdir=@libdir@
|
||||
+libdir=`pkg-config gdlib --variable=libdir`
|
||||
includedir=@includedir@
|
||||
bindir=@bindir@
|
||||
+ldflags=`pkg-config gdlib --variable=ldflags`
|
||||
|
||||
usage()
|
||||
{
|
||||
@@ -68,7 +69,7 @@
|
||||
echo @GDLIB_REVISION@
|
||||
;;
|
||||
--ldflags)
|
||||
- echo @LDFLAGS@
|
||||
+ echo $ldflags
|
||||
;;
|
||||
--libs)
|
||||
echo @LIBS@ @LIBICONV@
|
||||
@@ -83,7 +84,7 @@
|
||||
echo "GD library @VERSION@"
|
||||
echo "includedir: $includedir"
|
||||
echo "cflags: -I@includedir@"
|
||||
- echo "ldflags: @LDFLAGS@"
|
||||
+ echo "ldflags: $ldflags"
|
||||
echo "libs: @LIBS@ @LIBICONV@"
|
||||
echo "libdir: $libdir"
|
||||
echo "features: @FEATURES@"
|
||||
--- gd-2.0.34/configure.pom 2007-02-08 13:25:00.000000000 +0100
|
||||
+++ gd-2.0.34/configure 2007-02-08 13:31:53.000000000 +0100
|
||||
@@ -24672,7 +24672,7 @@
|
||||
Support for pthreads: $acx_pthread_ok
|
||||
" >&6; }
|
||||
|
||||
-ac_config_files="$ac_config_files Makefile config/Makefile config/gdlib-config test/Makefile"
|
||||
+ac_config_files="$ac_config_files Makefile config/Makefile config/gdlib-config config/gdlib.pc test/Makefile"
|
||||
|
||||
|
||||
cat >confcache <<\_ACEOF
|
||||
@@ -25257,6 +25257,7 @@
|
||||
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
||||
"config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;;
|
||||
"config/gdlib-config") CONFIG_FILES="$CONFIG_FILES config/gdlib-config" ;;
|
||||
+ "config/gdlib.pc" ) CONFIG_FILES="$CONFIG_FILES config/gdlib.pc" ;;
|
||||
"test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
|
||||
|
||||
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
|
@ -1,13 +0,0 @@
|
||||
--- gd-2.0.34/configure.sp 2007-02-08 13:44:32.000000000 +0100
|
||||
+++ gd-2.0.34/configure 2007-02-08 13:50:39.000000000 +0100
|
||||
@@ -9075,8 +9075,8 @@
|
||||
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
|
||||
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
|
||||
+ archive_cmds='$CC $CFLAGS -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
|
||||
+ archive_expsym_cmds='$CC $CFLAGS -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
@ -1,66 +0,0 @@
|
||||
diff -up gd-2.0.35/gd.c.AALineThick gd-2.0.35/gd.c
|
||||
--- gd-2.0.35/gd.c.AALineThick 2007-06-19 22:25:51.000000000 +0200
|
||||
+++ gd-2.0.35/gd.c 2012-02-28 11:02:09.708015922 +0100
|
||||
@@ -3474,6 +3474,8 @@ static void gdImageAALine (gdImagePtr im
|
||||
/* keep them as 32bits */
|
||||
long x, y, inc;
|
||||
long dx, dy,tmp;
|
||||
+ int w, wid, wstart;
|
||||
+ int thick = im->thick;
|
||||
|
||||
if (!im->trueColor) {
|
||||
/* TBB: don't crash when the image is of the wrong type */
|
||||
@@ -3502,6 +3504,25 @@ static void gdImageAALine (gdImagePtr im
|
||||
gdImageSetAAPixelColor(im, x1, y1, col, 0xFF);
|
||||
return;
|
||||
}
|
||||
+ else {
|
||||
+ double ag;
|
||||
+ if (abs(dy) < abs(dx))
|
||||
+ ag = cos (atan2 (dy, dx));
|
||||
+ else
|
||||
+ ag = sin (atan2 (dy, dx));
|
||||
+ if (ag != 0)
|
||||
+ {
|
||||
+ wid = abs(thick / ag);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ wid = 1;
|
||||
+ }
|
||||
+ if (wid == 0)
|
||||
+ {
|
||||
+ wid = 1;
|
||||
+ }
|
||||
+ }
|
||||
if (abs(dx) > abs(dy)) {
|
||||
if (dx < 0) {
|
||||
tmp = x1;
|
||||
@@ -3518,8 +3539,11 @@ static void gdImageAALine (gdImagePtr im
|
||||
inc = (dy * 65536) / dx;
|
||||
/* TBB: set the last pixel for consistency (<=) */
|
||||
while ((x >> 16) <= x2) {
|
||||
- gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (y >> 8) & 0xFF);
|
||||
- gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF);
|
||||
+ wstart = (y >> 16) - wid / 2;
|
||||
+ for (w = wstart; w < wstart + wid; w++) {
|
||||
+ gdImageSetAAPixelColor(im, (x >> 16) , w , col , (y >> 8) & 0xFF);
|
||||
+ gdImageSetAAPixelColor(im, (x >> 16) , w + 1 , col, (~y >> 8) & 0xFF);
|
||||
+ }
|
||||
x += (1 << 16);
|
||||
y += inc;
|
||||
}
|
||||
@@ -3539,8 +3563,11 @@ static void gdImageAALine (gdImagePtr im
|
||||
inc = (dx * 65536) / dy;
|
||||
/* TBB: set the last pixel for consistency (<=) */
|
||||
while ((y>>16) <= y2) {
|
||||
- gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (x >> 8) & 0xFF);
|
||||
- gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16),col, (~x >> 8) & 0xFF);
|
||||
+ wstart = (x >> 16) - wid / 2;
|
||||
+ for (w = wstart; w < wstart + wid; w++) {
|
||||
+ gdImageSetAAPixelColor(im, w , y >> 16 , col, (x >> 8) & 0xFF);
|
||||
+ gdImageSetAAPixelColor(im, w + 1, y >> 16, col, (~x >> 8) & 0xFF);
|
||||
+ }
|
||||
x += inc;
|
||||
y += (1<<16);
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
--- gd-2.0.35/gd_gd.c.pom 2006-04-05 17:52:22.000000000 +0200
|
||||
+++ gd-2.0.35/gd_gd.c 2007-09-05 11:31:39.000000000 +0200
|
||||
@@ -149,6 +149,10 @@ _gdCreateFromFile (gdIOCtx * in, int *sx
|
||||
{
|
||||
im = gdImageCreate (*sx, *sy);
|
||||
}
|
||||
+ if (!im)
|
||||
+ {
|
||||
+ goto fail1;
|
||||
+ }
|
||||
if (!_gdGetColors (in, im, gd2xFlag))
|
||||
{
|
||||
goto fail2;
|
@ -1,23 +0,0 @@
|
||||
diff -up gd-2.0.35/tests/CMakeLists.txt.tests gd-2.0.35/tests/CMakeLists.txt
|
||||
--- gd-2.0.35/tests/CMakeLists.txt.tests 2012-08-28 10:49:51.172059567 +0200
|
||||
+++ gd-2.0.35/tests/CMakeLists.txt 2012-08-28 10:49:43.251931396 +0200
|
||||
@@ -23,8 +23,8 @@ if (BUILD_TEST)
|
||||
include_directories (BEFORE ${GD_INCLUDE_DIR} "${GDTEST_SOURCE_DIR}")
|
||||
link_directories ("${GD_LIBS_DIR}" "${GDTEST_BINARY_DIR}/gdtest")
|
||||
|
||||
- #FIND_LIBRARY(GD_LIB "gd" PATHS ${GD_LIBS_DIR})
|
||||
- #message(STATUS "GD_LIB: ${GD_LIB}")
|
||||
+ FIND_LIBRARY(GD_LIB "gd" PATHS ${GD_LIBS_DIR})
|
||||
+ message(STATUS "GD_LIB: ${GD_LIB}")
|
||||
|
||||
SET(TESTS_DIRS
|
||||
gdtest
|
||||
@@ -33,7 +33,7 @@ if (BUILD_TEST)
|
||||
gdimagecolorexact
|
||||
gdimagecolorresolve
|
||||
#gdimageellipse
|
||||
- gdimageline
|
||||
+ #gdimageline
|
||||
gdimagefilledellipse
|
||||
gdimagecopyrotated
|
||||
gdtiled
|
@ -1,12 +0,0 @@
|
||||
--- gd-2.0.28/gd_gd.c 2004-05-24 17:28:12.000000000 +0200
|
||||
+++ gd-2.0.28_new/gd_gd.c 2009-12-08 15:19:16.159836680 +0100
|
||||
@@ -44,6 +44,9 @@
|
||||
{
|
||||
goto fail1;
|
||||
}
|
||||
+ if (im->colorsTotal > gdMaxColors) {
|
||||
+ goto fail1;
|
||||
+ }
|
||||
}
|
||||
/* Int to accommodate truecolor single-color transparency */
|
||||
if (!gdGetInt (&im->transparent, in))
|
@ -1,12 +0,0 @@
|
||||
diff -up gd-2.0.35/Makefile.in.time gd-2.0.35/Makefile.in
|
||||
--- gd-2.0.35/Makefile.in.time 2009-01-06 15:07:36.000000000 +0100
|
||||
+++ gd-2.0.35/Makefile.in 2009-01-06 15:09:54.000000000 +0100
|
||||
@@ -25,7 +25,7 @@ pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
-INSTALL = @INSTALL@
|
||||
+INSTALL = @INSTALL@ -p
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
33
gd-2.1.0-multilib.patch
Normal file
33
gd-2.1.0-multilib.patch
Normal file
@ -0,0 +1,33 @@
|
||||
diff -up gd-2.1.0/config/gdlib-config.in.multilib gd-2.1.0/config/gdlib-config.in
|
||||
--- gd-2.1.0/config/gdlib-config.in.multilib 2013-04-21 16:58:17.820010758 +0200
|
||||
+++ gd-2.1.0/config/gdlib-config.in 2013-04-21 16:59:27.896317922 +0200
|
||||
@@ -7,9 +7,10 @@
|
||||
# installation directories
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
-libdir=@libdir@
|
||||
+libdir=`pkg-config gdlib --variable=libdir`
|
||||
includedir=@includedir@
|
||||
bindir=@bindir@
|
||||
+ldflags=`pkg-config gdlib --variable=ldflags`
|
||||
|
||||
usage()
|
||||
{
|
||||
@@ -68,7 +69,7 @@ while test $# -gt 0; do
|
||||
echo @GDLIB_REVISION@
|
||||
;;
|
||||
--ldflags)
|
||||
- echo @LDFLAGS@
|
||||
+ echo $ldflags
|
||||
;;
|
||||
--libs)
|
||||
echo -lgd @LIBS@ @LIBICONV@
|
||||
@@ -83,7 +84,7 @@ while test $# -gt 0; do
|
||||
echo "GD library @VERSION@"
|
||||
echo "includedir: $includedir"
|
||||
echo "cflags: -I@includedir@"
|
||||
- echo "ldflags: @LDFLAGS@"
|
||||
+ echo "ldflags: $ldflags"
|
||||
echo "libs: @LIBS@ @LIBICONV@"
|
||||
echo "libdir: $libdir"
|
||||
echo "features: @FEATURES@"
|
1755
gd-aarch64.patch
1755
gd-aarch64.patch
File diff suppressed because it is too large
Load Diff
@ -1,24 +0,0 @@
|
||||
diff -up gd-2.0.35/gd_gif_in.c.loop gd-2.0.35/gd_gif_in.c
|
||||
--- gd-2.0.35/gd_gif_in.c.loop 2007-06-14 15:51:41.000000000 -0400
|
||||
+++ gd-2.0.35/gd_gif_in.c 2008-07-21 11:20:25.000000000 -0400
|
||||
@@ -453,16 +453,17 @@ LWZReadByte_(gdIOCtx *fd, LZW_STATIC_DAT
|
||||
return sd->firstcode;
|
||||
} else if (code == sd->end_code) {
|
||||
int count;
|
||||
+ int max_count = 1024;
|
||||
unsigned char buf[260];
|
||||
|
||||
if (*ZeroDataBlockP)
|
||||
return -2;
|
||||
|
||||
- while ((count = GetDataBlock(fd, buf, ZeroDataBlockP)) > 0)
|
||||
+ while ((count = GetDataBlock(fd, buf, ZeroDataBlockP)) > 0 && --max_count >= 0 )
|
||||
;
|
||||
|
||||
- if (count != 0)
|
||||
- return -2;
|
||||
+ if (count != 0 || max_count < 0 )
|
||||
+ return -2;
|
||||
}
|
||||
|
||||
incode = code;
|
59
gd-sa1.patch
59
gd-sa1.patch
@ -1,59 +0,0 @@
|
||||
These issues were found by Coverity static analysis tool
|
||||
|
||||
Error: DEADCODE (CWE-561): [#def3]
|
||||
gd-2.0.35/gd.c:3494: cond_cannot_single: Condition "dx == 0L", taking false branch. Now the value of "dx" cannot be equal to 0.
|
||||
gd-2.0.35/gd.c:3502: cannot_single: At condition "dx == 0L", the value of "dx" cannot be equal to 0.
|
||||
gd-2.0.35/gd.c:3502: dead_error_condition: The condition "dx == 0L" cannot be true.
|
||||
gd-2.0.35/gd.c:3502: dead_error_line: Execution cannot reach this expression "dy == 0L" inside statement "if (dx == 0L && dy == 0L){
|
||||
...".
|
||||
|
||||
Error: DEADCODE (CWE-561): [#def4]
|
||||
gd-2.0.35/gd.c:1085: cond_cannot_single: Condition "dx == 0", taking false branch. Now the value of "dx" cannot be equal to 0.
|
||||
gd-2.0.35/gd.c:1097: cannot_single: At condition "dx == 0", the value of "dx" cannot be equal to 0.
|
||||
gd-2.0.35/gd.c:1097: dead_error_condition: The condition "dx == 0" cannot be true.
|
||||
gd-2.0.35/gd.c:1097: dead_error_line: Execution cannot reach this expression "dy == 0" inside statement "if (dx == 0 && dy == 0){
|
||||
...".
|
||||
|
||||
|
||||
diff -up gd-2.0.35/gd.c.sa1 gd-2.0.35/gd.c
|
||||
--- gd-2.0.35/gd.c.sa1 2012-12-05 16:23:09.289667430 +0100
|
||||
+++ gd-2.0.35/gd.c 2012-12-05 16:30:41.634854587 +0100
|
||||
@@ -1094,11 +1094,6 @@ BGD_DECLARE(void) gdImageLine (gdImagePt
|
||||
{
|
||||
/* More-or-less horizontal. use wid for vertical stroke */
|
||||
/* Doug Claar: watch out for NaN in atan2 (2.0.5) */
|
||||
- if ((dx == 0) && (dy == 0))
|
||||
- {
|
||||
- wid = 1;
|
||||
- }
|
||||
- else
|
||||
{
|
||||
/* 2.0.12: Michael Schwartz: divide rather than multiply;
|
||||
TBB: but watch out for /0! */
|
||||
@@ -3490,6 +3485,12 @@ static void gdImageAALine (gdImagePtr im
|
||||
dx = x2 - x1;
|
||||
dy = y2 - y1;
|
||||
|
||||
+ if (dx == 0 && dy == 0) {
|
||||
+ /* TBB: allow setting points */
|
||||
+ gdImageSetAAPixelColor(im, x1, y1, col, 0xFF);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* Axis aligned lines */
|
||||
if (dx == 0) {
|
||||
gdImageVLine(im, x1, y1, y2, col);
|
||||
@@ -3499,12 +3500,7 @@ static void gdImageAALine (gdImagePtr im
|
||||
return;
|
||||
}
|
||||
|
||||
- if (dx == 0 && dy == 0) {
|
||||
- /* TBB: allow setting points */
|
||||
- gdImageSetAAPixelColor(im, x1, y1, col, 0xFF);
|
||||
- return;
|
||||
- }
|
||||
- else {
|
||||
+ {
|
||||
double ag;
|
||||
if (abs(dy) < abs(dx))
|
||||
ag = cos (atan2 (dy, dx));
|
515
gd-sa2.patch
515
gd-sa2.patch
@ -1,515 +0,0 @@
|
||||
The following issues have been found by Coverity static analysis tool:
|
||||
|
||||
Error: RESOURCE_LEAK (CWE-404): [#def25]
|
||||
gd-2.0.35/gd.c:2436: cond_false: Condition "overflow2(4 /* sizeof (int) */, srcW)", taking false branch
|
||||
gd-2.0.35/gd.c:2438: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2439: cond_false: Condition "overflow2(4 /* sizeof (int) */, srcH)", taking false branch
|
||||
gd-2.0.35/gd.c:2441: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2442: alloc_fn: Storage is returned from allocation function "gdMalloc(size_t)".
|
||||
gd-2.0.35/gdhelpers.c:85:3: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
|
||||
gd-2.0.35/gdhelpers.c:85:3: return_alloc_fn: Directly returning storage allocated by "malloc(size_t)".
|
||||
gd-2.0.35/gd.c:2442: var_assign: Assigning: "stx" = storage returned from "gdMalloc(4UL * srcW)".
|
||||
gd-2.0.35/gd.c:2443: cond_false: Condition "!stx", taking false branch
|
||||
gd-2.0.35/gd.c:2445: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2448: cond_true: Condition "!sty", taking true branch
|
||||
gd-2.0.35/gd.c:2449: leaked_storage: Variable "stx" going out of scope leaks the storage it points to.
|
||||
|
||||
Error: RESOURCE_LEAK (CWE-404): [#def26]
|
||||
gd-2.0.35/gd.c:2016: cond_false: Condition "!im->tile", taking false branch
|
||||
gd-2.0.35/gd.c:2018: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2021: cond_true: Condition "nc == -5", taking true branch
|
||||
gd-2.0.35/gd.c:2024: alloc_fn: Storage is returned from allocation function "gdCalloc(size_t, size_t)".
|
||||
gd-2.0.35/gdhelpers.c:79:3: alloc_fn: Storage is returned from allocation function "calloc(size_t, size_t)".
|
||||
gd-2.0.35/gdhelpers.c:79:3: return_alloc_fn: Directly returning storage allocated by "calloc(size_t, size_t)".
|
||||
gd-2.0.35/gd.c:2024: var_assign: Assigning: "pts" = storage returned from "gdCalloc(8UL * im->sy, 4UL)".
|
||||
gd-2.0.35/gd.c:2025: cond_false: Condition "!pts", taking false branch
|
||||
gd-2.0.35/gd.c:2027: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2029: cond_true: Condition "i < im->sy", taking true branch
|
||||
gd-2.0.35/gd.c:2032: cond_true: Condition "!pts[i]", taking true branch
|
||||
gd-2.0.35/gd.c:2033: cond_false: Condition "i >= 0", taking false branch
|
||||
gd-2.0.35/gd.c:2035: loop_end: Reached end of loop
|
||||
gd-2.0.35/gd.c:2036: leaked_storage: Variable "pts" going out of scope leaks the storage it points to.
|
||||
|
||||
Error: RESOURCE_LEAK (CWE-404): [#def27]
|
||||
gd-2.0.35/gd.c:2016: cond_false: Condition "!im->tile", taking false branch
|
||||
gd-2.0.35/gd.c:2018: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2021: cond_true: Condition "nc == -5", taking true branch
|
||||
gd-2.0.35/gd.c:2024: alloc_fn: Storage is returned from allocation function "gdCalloc(size_t, size_t)".
|
||||
gd-2.0.35/gdhelpers.c:79:3: alloc_fn: Storage is returned from allocation function "calloc(size_t, size_t)".
|
||||
gd-2.0.35/gdhelpers.c:79:3: return_alloc_fn: Directly returning storage allocated by "calloc(size_t, size_t)".
|
||||
gd-2.0.35/gd.c:2024: var_assign: Assigning: "pts" = storage returned from "gdCalloc(8UL * im->sy, 4UL)".
|
||||
gd-2.0.35/gd.c:2025: cond_false: Condition "!pts", taking false branch
|
||||
gd-2.0.35/gd.c:2027: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2029: cond_true: Condition "i < im->sy", taking true branch
|
||||
gd-2.0.35/gd.c:2032: cond_false: Condition "!pts[i]", taking false branch
|
||||
gd-2.0.35/gd.c:2037: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2038: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gd.c:2029: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gd.c:2029: cond_true: Condition "i < im->sy", taking true branch
|
||||
gd-2.0.35/gd.c:2032: cond_false: Condition "!pts[i]", taking false branch
|
||||
gd-2.0.35/gd.c:2037: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2038: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gd.c:2029: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gd.c:2029: cond_false: Condition "i < im->sy", taking false branch
|
||||
gd-2.0.35/gd.c:2038: loop_end: Reached end of loop
|
||||
gd-2.0.35/gd.c:2041: cond_true: Condition "!stack", taking true branch
|
||||
gd-2.0.35/gd.c:2042: leaked_storage: Variable "pts" going out of scope leaks the storage it points to.
|
||||
|
||||
Error: RESOURCE_LEAK (CWE-404): [#def28]
|
||||
gd-2.0.35/gd.c:2803: cond_false: Condition "!fgets(s, 160, fd)", taking false branch
|
||||
gd-2.0.35/gd.c:2806: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2810: cond_false: Condition "!sp", taking false branch
|
||||
gd-2.0.35/gd.c:2813: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2817: cond_false: Condition "!sp", taking false branch
|
||||
gd-2.0.35/gd.c:2820: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2823: cond_false: Condition "!w", taking false branch
|
||||
gd-2.0.35/gd.c:2826: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2827: cond_false: Condition "!fgets(s, 160, fd)", taking false branch
|
||||
gd-2.0.35/gd.c:2830: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2834: cond_false: Condition "!sp", taking false branch
|
||||
gd-2.0.35/gd.c:2837: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2841: cond_false: Condition "!sp", taking false branch
|
||||
gd-2.0.35/gd.c:2844: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2847: cond_false: Condition "!h", taking false branch
|
||||
gd-2.0.35/gd.c:2850: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2852: cond_false: Condition "!fgets(s, 160, fd)", taking false branch
|
||||
gd-2.0.35/gd.c:2855: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2857: alloc_fn: Storage is returned from allocation function "gdImageCreate(int, int)".
|
||||
gd-2.0.35/gd.c:76:3: cond_false: Condition "overflow2(8 /* sizeof (unsigned char *) */, sy)", taking false branch
|
||||
gd-2.0.35/gd.c:78:3: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:79:3: cond_false: Condition "overflow2(8 /* sizeof (unsigned char *) */, sx)", taking false branch
|
||||
gd-2.0.35/gd.c:81:3: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:83:3: alloc_fn: Storage is returned from allocation function "gdMalloc(size_t)".
|
||||
gd-2.0.35/gdhelpers.c:85:3: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
|
||||
gd-2.0.35/gdhelpers.c:85:3: return_alloc_fn: Directly returning storage allocated by "malloc(size_t)".
|
||||
gd-2.0.35/gd.c:83:3: var_assign: Assigning: "im" = "gdMalloc(7304UL)".
|
||||
gd-2.0.35/gd.c:84:2: cond_false: Condition "!im", taking false branch
|
||||
gd-2.0.35/gd.c:86:2: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:88:3: noescape: Resource "im" is not freed or pointed-to in function "memset(void *, int, size_t)".
|
||||
gd-2.0.35/gd.c:91:2: cond_false: Condition "!im->pixels", taking false branch
|
||||
gd-2.0.35/gd.c:94:2: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:101:3: cond_true: Condition "i < sy", taking true branch
|
||||
gd-2.0.35/gd.c:105:4: cond_false: Condition "!im->pixels[i]", taking false branch
|
||||
gd-2.0.35/gd.c:114:4: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:116:5: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gd.c:101:3: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gd.c:101:3: cond_true: Condition "i < sy", taking true branch
|
||||
gd-2.0.35/gd.c:105:4: cond_false: Condition "!im->pixels[i]", taking false branch
|
||||
gd-2.0.35/gd.c:114:4: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:116:5: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gd.c:101:3: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gd.c:101:3: cond_true: Condition "i < sy", taking true branch
|
||||
gd-2.0.35/gd.c:105:4: cond_false: Condition "!im->pixels[i]", taking false branch
|
||||
gd-2.0.35/gd.c:114:4: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:116:5: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gd.c:101:3: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gd.c:101:3: cond_false: Condition "i < sy", taking false branch
|
||||
gd-2.0.35/gd.c:116:5: loop_end: Reached end of loop
|
||||
gd-2.0.35/gd.c:124:3: cond_true: Condition "i < 256", taking true branch
|
||||
gd-2.0.35/gd.c:130:5: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gd.c:124:3: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gd.c:124:3: cond_true: Condition "i < 256", taking true branch
|
||||
gd-2.0.35/gd.c:130:5: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gd.c:124:3: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gd.c:124:3: cond_false: Condition "i < 256", taking false branch
|
||||
gd-2.0.35/gd.c:130:5: loop_end: Reached end of loop
|
||||
gd-2.0.35/gd.c:137:3: return_alloc: Returning allocated memory "im".
|
||||
gd-2.0.35/gd.c:2857: var_assign: Assigning: "im" = storage returned from "gdImageCreate(w, h)".
|
||||
gd-2.0.35/gd.c:2858: cond_false: Condition "!im", taking false branch
|
||||
gd-2.0.35/gd.c:2860: if_end: End of if statement
|
||||
gd-2.0.35/gd.c:2862: noescape: Resource "im" is not freed or pointed-to in function "gdImageColorAllocate(gdImagePtr, int, int, int)".
|
||||
gd-2.0.35/gd.c:478:51: noescape: "gdImageColorAllocate(gdImagePtr, int, int, int)" does not free or save its pointer parameter "im".
|
||||
gd-2.0.35/gd.c:2863: noescape: Resource "im" is not freed or pointed-to in function "gdImageColorAllocate(gdImagePtr, int, int, int)".
|
||||
gd-2.0.35/gd.c:478:51: noescape: "gdImageColorAllocate(gdImagePtr, int, int, int)" does not free or save its pointer parameter "im".
|
||||
gd-2.0.35/gd.c:2866: cond_false: Condition "i < bytes", taking false branch
|
||||
gd-2.0.35/gd.c:2913: loop_end: Reached end of loop
|
||||
gd-2.0.35/gd.c:2916: leaked_storage: Variable "im" going out of scope leaks the storage it points to.
|
||||
|
||||
Error: RESOURCE_LEAK (CWE-404): [#def29]
|
||||
gd-2.0.35/gdft.c:881: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:883: cond_true: Condition "(strex->flags & 1) == 1", taking true branch
|
||||
gd-2.0.35/gdft.c:888: alloc_fn: Storage is returned from allocation function "gdCacheCreate(int, gdCacheTestFn_t, gdCacheFetchFn_t, gdCacheReleaseFn_t)".
|
||||
gd-2.0.35/gdcache.c:73:3: alloc_fn: Storage is returned from allocation function "gdMalloc(size_t)".
|
||||
gd-2.0.35/gdhelpers.c:85:3: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
|
||||
gd-2.0.35/gdhelpers.c:85:3: return_alloc_fn: Directly returning storage allocated by "malloc(size_t)".
|
||||
gd-2.0.35/gdcache.c:73:3: var_assign: Assigning: "head" = "gdMalloc(48UL)".
|
||||
gd-2.0.35/gdcache.c:74:2: cond_false: Condition "!head", taking false branch
|
||||
gd-2.0.35/gdcache.c:76:2: if_end: End of if statement
|
||||
gd-2.0.35/gdcache.c:83:3: return_alloc: Returning allocated memory "head".
|
||||
gd-2.0.35/gdft.c:888: var_assign: Assigning: "tc_cache" = storage returned from "gdCacheCreate(32, tweenColorTest(void *, void *), tweenColorFetch(char **, void *), tweenColorRelease(void *))".
|
||||
gd-2.0.35/gdft.c:893: cond_true: Condition "!fontCache", taking true branch
|
||||
gd-2.0.35/gdft.c:895: cond_false: Condition "gdFontCacheSetup() != 0", taking false branch
|
||||
gd-2.0.35/gdft.c:899: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:905: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:906: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:909: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:912: cond_false: Condition "!font", taking false branch
|
||||
gd-2.0.35/gdft.c:917: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:921: cond_true: Condition "brect", taking true branch
|
||||
gd-2.0.35/gdft.c:935: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:937: cond_true: Condition "strex->flags & 4", taking true branch
|
||||
gd-2.0.35/gdft.c:942: cond_true: Condition "strex->flags & 0x10", taking true branch
|
||||
gd-2.0.35/gdft.c:948: cond_true: Condition "strex->flags & 2", taking true branch
|
||||
gd-2.0.35/gdft.c:953: cond_true: Condition "strex->flags & 0x80", taking true branch
|
||||
gd-2.0.35/gdft.c:954: cond_false: Condition "0", taking false branch
|
||||
gd-2.0.35/gdft.c:954: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:956: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:969: cond_false: Condition "FT_Set_Char_Size(face, 0, (FT_F26Dot6)(ptsize * 64), 300, 300)", taking false branch
|
||||
gd-2.0.35/gdft.c:974: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:976: cond_true: Condition "render", taking true branch
|
||||
gd-2.0.35/gdft.c:980: cond_false: Condition "FT_Set_Char_Size(face, 0, (FT_F26Dot6)(ptsize * 64), hdpi, vdpi)", taking false branch
|
||||
gd-2.0.35/gdft.c:985: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:988: cond_true: Condition "fg < 0", taking true branch
|
||||
gd-2.0.35/gdft.c:993: cond_true: Condition "i < face->num_charmaps", taking true branch
|
||||
gd-2.0.35/gdft.c:998: cond_true: Condition "encoding == 0", taking true branch
|
||||
gd-2.0.35/gdft.c:1000: cond_true: Condition "charmap->encoding == FT_ENCODING_MS_SYMBOL", taking true branch
|
||||
gd-2.0.35/gdft.c:1006: break: Breaking from loop
|
||||
gd-2.0.35/gdft.c:1070: loop_end: Reached end of loop
|
||||
gd-2.0.35/gdft.c:1071: cond_true: Condition "encodingfound", taking true branch
|
||||
gd-2.0.35/gdft.c:1074: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:1080: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1083: cond_false: Condition "encoding == 1", taking false branch
|
||||
gd-2.0.35/gdft.c:1098: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1110: cond_true: Condition "*next", taking true branch
|
||||
gd-2.0.35/gdft.c:1117: cond_true: Condition "ch == 13", taking true branch
|
||||
gd-2.0.35/gdft.c:1122: continue: Continuing loop
|
||||
gd-2.0.35/gdft.c:1355: loop: Looping back
|
||||
gd-2.0.35/gdft.c:1110: cond_true: Condition "*next", taking true branch
|
||||
gd-2.0.35/gdft.c:1117: cond_true: Condition "ch == 13", taking true branch
|
||||
gd-2.0.35/gdft.c:1122: continue: Continuing loop
|
||||
gd-2.0.35/gdft.c:1355: loop: Looping back
|
||||
gd-2.0.35/gdft.c:1110: cond_true: Condition "*next", taking true branch
|
||||
gd-2.0.35/gdft.c:1117: cond_false: Condition "ch == 13", taking false branch
|
||||
gd-2.0.35/gdft.c:1123: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1125: cond_true: Condition "ch == 10", taking true branch
|
||||
gd-2.0.35/gdft.c:1133: continue: Continuing loop
|
||||
gd-2.0.35/gdft.c:1355: loop: Looping back
|
||||
gd-2.0.35/gdft.c:1110: cond_true: Condition "*next", taking true branch
|
||||
gd-2.0.35/gdft.c:1117: cond_false: Condition "ch == 13", taking false branch
|
||||
gd-2.0.35/gdft.c:1123: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1125: cond_false: Condition "ch == 10", taking false branch
|
||||
gd-2.0.35/gdft.c:1134: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1137: switch: Switch case value "0"
|
||||
gd-2.0.35/gdft.c:1139: switch_case: Reached case "0"
|
||||
gd-2.0.35/gdft.c:1147: cond_true: Condition "charmap->encoding == FT_ENCODING_MS_SYMBOL", taking true branch
|
||||
gd-2.0.35/gdft.c:1160: break: Breaking from switch
|
||||
gd-2.0.35/gdft.c:1218: switch_end: Reached end of switch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_false: Condition "strex->flags & 8", taking false branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "!(face->face_flags & (4L /* 1L << 2 */))", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "face->face_flags & (64L /* 1L << 6 */)", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_false: Condition "previous", taking false branch
|
||||
gd-2.0.35/gdft.c:1231: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "i", taking true branch
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "strex->flags & 0x10", taking true branch
|
||||
gd-2.0.35/gdft.c:1242: cond_true: Condition "!xshow_alloc", taking true branch
|
||||
gd-2.0.35/gdft.c:1245: cond_false: Condition "!strex->xshow", taking false branch
|
||||
gd-2.0.35/gdft.c:1247: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1249: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:1256: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1264: cond_false: Condition "err", taking false branch
|
||||
gd-2.0.35/gdft.c:1269: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1273: cond_true: Condition "brect", taking true branch
|
||||
gd-2.0.35/gdft.c:1281: cond_false: Condition "ch == 32", taking false branch
|
||||
gd-2.0.35/gdft.c:1286: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1295: cond_false: Condition "i == 0", taking false branch
|
||||
gd-2.0.35/gdft.c:1301: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1302: cond_true: Condition "glyph_min.x < total_min.x", taking true branch
|
||||
gd-2.0.35/gdft.c:1304: cond_true: Condition "glyph_min.y < total_min.y", taking true branch
|
||||
gd-2.0.35/gdft.c:1306: cond_true: Condition "glyph_max.x > total_max.x", taking true branch
|
||||
gd-2.0.35/gdft.c:1308: cond_true: Condition "glyph_max.y > total_max.y", taking true branch
|
||||
gd-2.0.35/gdft.c:1313: cond_true: Condition "render", taking true branch
|
||||
gd-2.0.35/gdft.c:1319: cond_false: Condition "err", taking false branch
|
||||
gd-2.0.35/gdft.c:1324: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1329: cond_true: Condition "image->format != FT_GLYPH_FORMAT_BITMAP", taking true branch
|
||||
gd-2.0.35/gdft.c:1332: cond_false: Condition "err", taking false branch
|
||||
gd-2.0.35/gdft.c:1337: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1344: noescape: Resource "tc_cache" is not freed or pointed-to in function "gdft_draw_bitmap(gdCache_head_t *, gdImage *, int, FT_Bitmap, int, int)".
|
||||
gd-2.0.35/gdft.c:614:36: noescape: "gdft_draw_bitmap(gdCache_head_t *, gdImage *, int, FT_Bitmap, int, int)" does not free or save its pointer parameter "tc_cache".
|
||||
gd-2.0.35/gdft.c:1355: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gdft.c:1110: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gdft.c:1110: cond_true: Condition "*next", taking true branch
|
||||
gd-2.0.35/gdft.c:1117: cond_false: Condition "ch == 13", taking false branch
|
||||
gd-2.0.35/gdft.c:1123: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1125: cond_false: Condition "ch == 10", taking false branch
|
||||
gd-2.0.35/gdft.c:1134: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1137: switch: Switch case value "0"
|
||||
gd-2.0.35/gdft.c:1139: switch_case: Reached case "0"
|
||||
gd-2.0.35/gdft.c:1147: cond_true: Condition "charmap->encoding == FT_ENCODING_MS_SYMBOL", taking true branch
|
||||
gd-2.0.35/gdft.c:1160: break: Breaking from switch
|
||||
gd-2.0.35/gdft.c:1218: switch_end: Reached end of switch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_false: Condition "strex->flags & 8", taking false branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "!(face->face_flags & (4L /* 1L << 2 */))", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "face->face_flags & (64L /* 1L << 6 */)", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "previous", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "glyph_index", taking true branch
|
||||
gd-2.0.35/gdft.c:1229: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:1231: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "i", taking true branch
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "strex->flags & 0x10", taking true branch
|
||||
gd-2.0.35/gdft.c:1242: cond_false: Condition "!xshow_alloc", taking false branch
|
||||
gd-2.0.35/gdft.c:1250: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1250: cond_true: Condition "xshow_pos + 20 > xshow_alloc", taking true branch
|
||||
gd-2.0.35/gdft.c:1253: cond_false: Condition "!strex->xshow", taking false branch
|
||||
gd-2.0.35/gdft.c:1255: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1264: cond_false: Condition "err", taking false branch
|
||||
gd-2.0.35/gdft.c:1269: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1273: cond_true: Condition "brect", taking true branch
|
||||
gd-2.0.35/gdft.c:1281: cond_false: Condition "ch == 32", taking false branch
|
||||
gd-2.0.35/gdft.c:1286: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1295: cond_false: Condition "i == 0", taking false branch
|
||||
gd-2.0.35/gdft.c:1301: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1302: cond_true: Condition "glyph_min.x < total_min.x", taking true branch
|
||||
gd-2.0.35/gdft.c:1304: cond_true: Condition "glyph_min.y < total_min.y", taking true branch
|
||||
gd-2.0.35/gdft.c:1306: cond_true: Condition "glyph_max.x > total_max.x", taking true branch
|
||||
gd-2.0.35/gdft.c:1308: cond_true: Condition "glyph_max.y > total_max.y", taking true branch
|
||||
gd-2.0.35/gdft.c:1313: cond_true: Condition "render", taking true branch
|
||||
gd-2.0.35/gdft.c:1319: cond_false: Condition "err", taking false branch
|
||||
gd-2.0.35/gdft.c:1324: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1329: cond_true: Condition "image->format != FT_GLYPH_FORMAT_BITMAP", taking true branch
|
||||
gd-2.0.35/gdft.c:1332: cond_false: Condition "err", taking false branch
|
||||
gd-2.0.35/gdft.c:1337: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1344: noescape: Resource "tc_cache" is not freed or pointed-to in function "gdft_draw_bitmap(gdCache_head_t *, gdImage *, int, FT_Bitmap, int, int)".
|
||||
gd-2.0.35/gdft.c:614:36: noescape: "gdft_draw_bitmap(gdCache_head_t *, gdImage *, int, FT_Bitmap, int, int)" does not free or save its pointer parameter "tc_cache".
|
||||
gd-2.0.35/gdft.c:1355: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gdft.c:1110: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gdft.c:1110: cond_true: Condition "*next", taking true branch
|
||||
gd-2.0.35/gdft.c:1117: cond_false: Condition "ch == 13", taking false branch
|
||||
gd-2.0.35/gdft.c:1123: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1125: cond_false: Condition "ch == 10", taking false branch
|
||||
gd-2.0.35/gdft.c:1134: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1137: switch: Switch case value "0"
|
||||
gd-2.0.35/gdft.c:1139: switch_case: Reached case "0"
|
||||
gd-2.0.35/gdft.c:1147: cond_true: Condition "charmap->encoding == FT_ENCODING_MS_SYMBOL", taking true branch
|
||||
gd-2.0.35/gdft.c:1160: break: Breaking from switch
|
||||
gd-2.0.35/gdft.c:1218: switch_end: Reached end of switch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_false: Condition "strex->flags & 8", taking false branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "!(face->face_flags & (4L /* 1L << 2 */))", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "face->face_flags & (64L /* 1L << 6 */)", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "previous", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "glyph_index", taking true branch
|
||||
gd-2.0.35/gdft.c:1229: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:1231: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "i", taking true branch
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "strex->flags & 0x10", taking true branch
|
||||
gd-2.0.35/gdft.c:1242: cond_false: Condition "!xshow_alloc", taking false branch
|
||||
gd-2.0.35/gdft.c:1250: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1250: cond_true: Condition "xshow_pos + 20 > xshow_alloc", taking true branch
|
||||
gd-2.0.35/gdft.c:1253: cond_true: Condition "!strex->xshow", taking true branch
|
||||
gd-2.0.35/gdft.c:1254: leaked_storage: Variable "tc_cache" going out of scope leaks the storage it points to.
|
||||
|
||||
Error: RESOURCE_LEAK (CWE-404): [#def30]
|
||||
gd-2.0.35/gdft.c:881: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:883: cond_true: Condition "(strex->flags & 1) == 1", taking true branch
|
||||
gd-2.0.35/gdft.c:888: alloc_fn: Storage is returned from allocation function "gdCacheCreate(int, gdCacheTestFn_t, gdCacheFetchFn_t, gdCacheReleaseFn_t)".
|
||||
gd-2.0.35/gdcache.c:73:3: alloc_fn: Storage is returned from allocation function "gdMalloc(size_t)".
|
||||
gd-2.0.35/gdhelpers.c:85:3: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
|
||||
gd-2.0.35/gdhelpers.c:85:3: return_alloc_fn: Directly returning storage allocated by "malloc(size_t)".
|
||||
gd-2.0.35/gdcache.c:73:3: var_assign: Assigning: "head" = "gdMalloc(48UL)".
|
||||
gd-2.0.35/gdcache.c:74:2: cond_false: Condition "!head", taking false branch
|
||||
gd-2.0.35/gdcache.c:76:2: if_end: End of if statement
|
||||
gd-2.0.35/gdcache.c:83:3: return_alloc: Returning allocated memory "head".
|
||||
gd-2.0.35/gdft.c:888: var_assign: Assigning: "tc_cache" = storage returned from "gdCacheCreate(32, tweenColorTest(void *, void *), tweenColorFetch(char **, void *), tweenColorRelease(void *))".
|
||||
gd-2.0.35/gdft.c:893: cond_true: Condition "!fontCache", taking true branch
|
||||
gd-2.0.35/gdft.c:895: cond_false: Condition "gdFontCacheSetup() != 0", taking false branch
|
||||
gd-2.0.35/gdft.c:899: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:905: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:906: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:909: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:912: cond_false: Condition "!font", taking false branch
|
||||
gd-2.0.35/gdft.c:917: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:921: cond_true: Condition "brect", taking true branch
|
||||
gd-2.0.35/gdft.c:935: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:937: cond_true: Condition "strex->flags & 4", taking true branch
|
||||
gd-2.0.35/gdft.c:942: cond_true: Condition "strex->flags & 0x10", taking true branch
|
||||
gd-2.0.35/gdft.c:948: cond_true: Condition "strex->flags & 2", taking true branch
|
||||
gd-2.0.35/gdft.c:953: cond_true: Condition "strex->flags & 0x80", taking true branch
|
||||
gd-2.0.35/gdft.c:954: cond_false: Condition "0", taking false branch
|
||||
gd-2.0.35/gdft.c:954: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:956: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:969: cond_false: Condition "FT_Set_Char_Size(face, 0, (FT_F26Dot6)(ptsize * 64), 300, 300)", taking false branch
|
||||
gd-2.0.35/gdft.c:974: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:976: cond_true: Condition "render", taking true branch
|
||||
gd-2.0.35/gdft.c:980: cond_false: Condition "FT_Set_Char_Size(face, 0, (FT_F26Dot6)(ptsize * 64), hdpi, vdpi)", taking false branch
|
||||
gd-2.0.35/gdft.c:985: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:988: cond_true: Condition "fg < 0", taking true branch
|
||||
gd-2.0.35/gdft.c:993: cond_true: Condition "i < face->num_charmaps", taking true branch
|
||||
gd-2.0.35/gdft.c:998: cond_true: Condition "encoding == 0", taking true branch
|
||||
gd-2.0.35/gdft.c:1000: cond_false: Condition "charmap->encoding == FT_ENCODING_MS_SYMBOL", taking false branch
|
||||
gd-2.0.35/gdft.c:1000: cond_false: Condition "charmap->encoding == FT_ENCODING_UNICODE", taking false branch
|
||||
gd-2.0.35/gdft.c:1000: cond_false: Condition "charmap->encoding == FT_ENCODING_ADOBE_CUSTOM", taking false branch
|
||||
gd-2.0.35/gdft.c:1000: cond_false: Condition "charmap->encoding == FT_ENCODING_ADOBE_STANDARD", taking false branch
|
||||
gd-2.0.35/gdft.c:1007: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1008: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:1040: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1070: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gdft.c:993: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gdft.c:993: cond_true: Condition "i < face->num_charmaps", taking true branch
|
||||
gd-2.0.35/gdft.c:998: cond_true: Condition "encoding == 0", taking true branch
|
||||
gd-2.0.35/gdft.c:1000: cond_false: Condition "charmap->encoding == FT_ENCODING_MS_SYMBOL", taking false branch
|
||||
gd-2.0.35/gdft.c:1000: cond_false: Condition "charmap->encoding == FT_ENCODING_UNICODE", taking false branch
|
||||
gd-2.0.35/gdft.c:1000: cond_false: Condition "charmap->encoding == FT_ENCODING_ADOBE_CUSTOM", taking false branch
|
||||
gd-2.0.35/gdft.c:1000: cond_false: Condition "charmap->encoding == FT_ENCODING_ADOBE_STANDARD", taking false branch
|
||||
gd-2.0.35/gdft.c:1007: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1008: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:1040: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1070: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gdft.c:993: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gdft.c:993: cond_false: Condition "i < face->num_charmaps", taking false branch
|
||||
gd-2.0.35/gdft.c:1070: loop_end: Reached end of loop
|
||||
gd-2.0.35/gdft.c:1071: cond_false: Condition "encodingfound", taking false branch
|
||||
gd-2.0.35/gdft.c:1076: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1079: leaked_storage: Variable "tc_cache" going out of scope leaks the storage it points to.
|
||||
|
||||
Error: RESOURCE_LEAK (CWE-404): [#def31]
|
||||
gd-2.0.35/gdft.c:881: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:883: cond_true: Condition "(strex->flags & 1) == 1", taking true branch
|
||||
gd-2.0.35/gdft.c:888: alloc_fn: Storage is returned from allocation function "gdCacheCreate(int, gdCacheTestFn_t, gdCacheFetchFn_t, gdCacheReleaseFn_t)".
|
||||
gd-2.0.35/gdcache.c:73:3: alloc_fn: Storage is returned from allocation function "gdMalloc(size_t)".
|
||||
gd-2.0.35/gdhelpers.c:85:3: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
|
||||
gd-2.0.35/gdhelpers.c:85:3: return_alloc_fn: Directly returning storage allocated by "malloc(size_t)".
|
||||
gd-2.0.35/gdcache.c:73:3: var_assign: Assigning: "head" = "gdMalloc(48UL)".
|
||||
gd-2.0.35/gdcache.c:74:2: cond_false: Condition "!head", taking false branch
|
||||
gd-2.0.35/gdcache.c:76:2: if_end: End of if statement
|
||||
gd-2.0.35/gdcache.c:83:3: return_alloc: Returning allocated memory "head".
|
||||
gd-2.0.35/gdft.c:888: var_assign: Assigning: "tc_cache" = storage returned from "gdCacheCreate(32, tweenColorTest(void *, void *), tweenColorFetch(char **, void *), tweenColorRelease(void *))".
|
||||
gd-2.0.35/gdft.c:893: cond_true: Condition "!fontCache", taking true branch
|
||||
gd-2.0.35/gdft.c:895: cond_false: Condition "gdFontCacheSetup() != 0", taking false branch
|
||||
gd-2.0.35/gdft.c:899: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:905: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:906: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:909: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:912: cond_false: Condition "!font", taking false branch
|
||||
gd-2.0.35/gdft.c:917: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:921: cond_true: Condition "brect", taking true branch
|
||||
gd-2.0.35/gdft.c:935: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:937: cond_true: Condition "strex->flags & 4", taking true branch
|
||||
gd-2.0.35/gdft.c:942: cond_true: Condition "strex->flags & 0x10", taking true branch
|
||||
gd-2.0.35/gdft.c:948: cond_true: Condition "strex->flags & 2", taking true branch
|
||||
gd-2.0.35/gdft.c:953: cond_true: Condition "strex->flags & 0x80", taking true branch
|
||||
gd-2.0.35/gdft.c:954: cond_false: Condition "0", taking false branch
|
||||
gd-2.0.35/gdft.c:954: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:956: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:969: cond_false: Condition "FT_Set_Char_Size(face, 0, (FT_F26Dot6)(ptsize * 64), 300, 300)", taking false branch
|
||||
gd-2.0.35/gdft.c:974: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:976: cond_true: Condition "render", taking true branch
|
||||
gd-2.0.35/gdft.c:980: cond_false: Condition "FT_Set_Char_Size(face, 0, (FT_F26Dot6)(ptsize * 64), hdpi, vdpi)", taking false branch
|
||||
gd-2.0.35/gdft.c:985: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:988: cond_true: Condition "fg < 0", taking true branch
|
||||
gd-2.0.35/gdft.c:993: cond_true: Condition "i < face->num_charmaps", taking true branch
|
||||
gd-2.0.35/gdft.c:998: cond_true: Condition "encoding == 0", taking true branch
|
||||
gd-2.0.35/gdft.c:1000: cond_true: Condition "charmap->encoding == FT_ENCODING_MS_SYMBOL", taking true branch
|
||||
gd-2.0.35/gdft.c:1006: break: Breaking from loop
|
||||
gd-2.0.35/gdft.c:1070: loop_end: Reached end of loop
|
||||
gd-2.0.35/gdft.c:1071: cond_true: Condition "encodingfound", taking true branch
|
||||
gd-2.0.35/gdft.c:1074: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gdft.c:1080: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1083: cond_false: Condition "encoding == 1", taking false branch
|
||||
gd-2.0.35/gdft.c:1098: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1110: cond_true: Condition "*next", taking true branch
|
||||
gd-2.0.35/gdft.c:1117: cond_true: Condition "ch == 13", taking true branch
|
||||
gd-2.0.35/gdft.c:1122: continue: Continuing loop
|
||||
gd-2.0.35/gdft.c:1355: loop: Looping back
|
||||
gd-2.0.35/gdft.c:1110: cond_true: Condition "*next", taking true branch
|
||||
gd-2.0.35/gdft.c:1117: cond_true: Condition "ch == 13", taking true branch
|
||||
gd-2.0.35/gdft.c:1122: continue: Continuing loop
|
||||
gd-2.0.35/gdft.c:1355: loop: Looping back
|
||||
gd-2.0.35/gdft.c:1110: cond_true: Condition "*next", taking true branch
|
||||
gd-2.0.35/gdft.c:1117: cond_false: Condition "ch == 13", taking false branch
|
||||
gd-2.0.35/gdft.c:1123: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1125: cond_true: Condition "ch == 10", taking true branch
|
||||
gd-2.0.35/gdft.c:1133: continue: Continuing loop
|
||||
gd-2.0.35/gdft.c:1355: loop: Looping back
|
||||
gd-2.0.35/gdft.c:1110: cond_true: Condition "*next", taking true branch
|
||||
gd-2.0.35/gdft.c:1117: cond_false: Condition "ch == 13", taking false branch
|
||||
gd-2.0.35/gdft.c:1123: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1125: cond_false: Condition "ch == 10", taking false branch
|
||||
gd-2.0.35/gdft.c:1134: if_end: End of if statement
|
||||
gd-2.0.35/gdft.c:1137: switch: Switch case value "0"
|
||||
gd-2.0.35/gdft.c:1139: switch_case: Reached case "0"
|
||||
gd-2.0.35/gdft.c:1147: cond_true: Condition "charmap->encoding == FT_ENCODING_MS_SYMBOL", taking true branch
|
||||
gd-2.0.35/gdft.c:1160: break: Breaking from switch
|
||||
gd-2.0.35/gdft.c:1218: switch_end: Reached end of switch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_false: Condition "strex->flags & 8", taking false branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "!(face->face_flags & (4L /* 1L << 2 */))", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_true: Condition "face->face_flags & (64L /* 1L << 6 */)", taking true branch
|
||||
gd-2.0.35/gdft.c:1224: cond_false: Condition "previous", taking false branch
|
||||
gd-2.0.35/gdft.c:1231: else_branch: Reached else branch
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "i", taking true branch
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "strex", taking true branch
|
||||
gd-2.0.35/gdft.c:1238: cond_true: Condition "strex->flags & 0x10", taking true branch
|
||||
gd-2.0.35/gdft.c:1242: cond_true: Condition "!xshow_alloc", taking true branch
|
||||
gd-2.0.35/gdft.c:1245: cond_true: Condition "!strex->xshow", taking true branch
|
||||
gd-2.0.35/gdft.c:1246: leaked_storage: Variable "tc_cache" going out of scope leaks the storage it points to.
|
||||
|
||||
|
||||
diff -up gd-2.0.35/gd.c.sa2 gd-2.0.35/gd.c
|
||||
--- gd-2.0.35/gd.c.sa2 2012-12-05 17:01:03.989841899 +0100
|
||||
+++ gd-2.0.35/gd.c 2012-12-05 17:06:58.283055944 +0100
|
||||
@@ -2028,12 +2028,17 @@ void _gdImageFillTiled(gdImagePtr im, in
|
||||
for (--i ; i >= 0; i--) {
|
||||
gdFree(pts[i]);
|
||||
}
|
||||
+ gdFree(pts);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
stack = (struct seg *)gdMalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4));
|
||||
if (!stack) {
|
||||
+ for (i=0; i<im->sy;i++) {
|
||||
+ gdFree(pts[i]);
|
||||
+ }
|
||||
+ gdFree(pts);
|
||||
return;
|
||||
}
|
||||
sp = stack;
|
||||
@@ -2441,6 +2446,7 @@ BGD_DECLARE(void) gdImageCopyResized (gd
|
||||
|
||||
sty = (int *) gdMalloc (sizeof (int) * srcH);
|
||||
if (!sty) {
|
||||
+ gdFree(stx);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2908,7 +2914,6 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFro
|
||||
}
|
||||
/* Shouldn't happen */
|
||||
fprintf (stderr, "Error: bug in gdImageCreateFromXbm!\n");
|
||||
- return 0;
|
||||
fail:
|
||||
gdImageDestroy (im);
|
||||
return 0;
|
||||
diff -up gd-2.0.35/gdft.c.sa2 gd-2.0.35/gdft.c
|
||||
--- gd-2.0.35/gdft.c.sa2 2012-12-05 17:30:16.884852950 +0100
|
||||
+++ gd-2.0.35/gdft.c 2012-12-05 17:11:42.635217211 +0100
|
||||
@@ -1076,6 +1076,7 @@ BGD_DECLARE(char *) gdImageStringFTEx (g
|
||||
{
|
||||
/* No character set found! */
|
||||
gdMutexUnlock (gdFontCacheMutex);
|
||||
+ gdCacheDelete (tc_cache);
|
||||
return "No character set found";
|
||||
}
|
||||
|
||||
@@ -1243,6 +1244,7 @@ fprintf(stderr,"dpi=%d,%d metric_res=%d
|
||||
xshow_alloc = 100;
|
||||
strex->xshow = gdMalloc(xshow_alloc);
|
||||
if (!strex->xshow) {
|
||||
+ gdCacheDelete (tc_cache);
|
||||
return 0;
|
||||
}
|
||||
xshow_pos = 0;
|
||||
@@ -1251,6 +1253,7 @@ fprintf(stderr,"dpi=%d,%d metric_res=%d
|
||||
xshow_alloc += 100;
|
||||
strex->xshow = gdRealloc(strex->xshow, xshow_alloc);
|
||||
if (!strex->xshow) {
|
||||
+ gdCacheDelete (tc_cache);
|
||||
return 0;
|
||||
}
|
||||
}
|
31
gd-sa3.patch
31
gd-sa3.patch
@ -1,31 +0,0 @@
|
||||
The following issue has been found by Coverity static analysis tool.
|
||||
|
||||
Error: STRING_OVERFLOW (CWE-120): [#def53]
|
||||
gd-2.0.35/annotate.c:42: cond_false: Condition "argc != 3", taking false branch
|
||||
gd-2.0.35/annotate.c:60: if_end: End of if statement
|
||||
gd-2.0.35/annotate.c:64: cond_false: Condition "!in", taking false branch
|
||||
gd-2.0.35/annotate.c:68: if_end: End of if statement
|
||||
gd-2.0.35/annotate.c:75: cond_false: Condition "!im", taking false branch
|
||||
gd-2.0.35/annotate.c:79: if_end: End of if statement
|
||||
gd-2.0.35/annotate.c:80: cond_true: Condition "fgets(s, 1024 /* sizeof (s) */, stdin)", taking true branch
|
||||
gd-2.0.35/annotate.c:85: cond_false: Condition "!st", taking false branch
|
||||
gd-2.0.35/annotate.c:89: if_end: End of if statement
|
||||
gd-2.0.35/annotate.c:90: cond_true: Condition "!__coverity_strcmp(st, "font")", taking true branch
|
||||
gd-2.0.35/annotate.c:93: cond_false: Condition "!st", taking false branch
|
||||
gd-2.0.35/annotate.c:96: if_end: End of if statement
|
||||
gd-2.0.35/annotate.c:97: fixed_size_dest: You might overrun the 1024 byte fixed-size string "font" by copying "st" without checking the length.
|
||||
|
||||
diff -up gd-2.0.35/annotate.c.sa3 gd-2.0.35/annotate.c
|
||||
--- gd-2.0.35/annotate.c.sa3 2012-12-05 17:26:21.157729019 +0100
|
||||
+++ gd-2.0.35/annotate.c 2012-12-05 17:27:31.762762209 +0100
|
||||
@@ -94,6 +94,10 @@ main (int argc, char *argv[])
|
||||
{
|
||||
goto badLine;
|
||||
}
|
||||
+ if (strlen(st) >= sizeof(font) - 1)
|
||||
+ {
|
||||
+ goto badLine;
|
||||
+ }
|
||||
strcpy (font, st);
|
||||
}
|
||||
else if (!strcmp (st, "align"))
|
148
gd-sa4.patch
148
gd-sa4.patch
@ -1,148 +0,0 @@
|
||||
The following issue has been found by Coverity static analysis tool.
|
||||
|
||||
Error: FORWARD_NULL (CWE-476): [#def5]
|
||||
gd-2.0.35/gd_topal.c:1790: assign_zero: Assigning: "cquantize" = "NULL".
|
||||
gd-2.0.35/gd_topal.c:1798: cond_false: Condition "cimP", taking false branch
|
||||
gd-2.0.35/gd_topal.c:1804: else_branch: Reached else branch
|
||||
gd-2.0.35/gd_topal.c:1807: cond_false: Condition "!oim->trueColor", taking false branch
|
||||
gd-2.0.35/gd_topal.c:1815: if_end: End of if statement
|
||||
gd-2.0.35/gd_topal.c:1819: cond_true: Condition "oim->transparent >= 0", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1823: cond_true: Condition "colorsWanted > maxColors", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1827: cond_true: Condition "!cimP", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1829: cond_false: Condition "!nim->pixels", taking false branch
|
||||
gd-2.0.35/gd_topal.c:1833: if_end: End of if statement
|
||||
gd-2.0.35/gd_topal.c:1834: cond_true: Condition "i < nim->sy", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1837: cond_true: Condition "!nim->pixels[i]", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1839: goto: Jumping to label "outOfMemory"
|
||||
gd-2.0.35/gd_topal.c:2027: label: Reached label "outOfMemory"
|
||||
gd-2.0.35/gd_topal.c:2028: cond_true: Condition "oim->trueColor", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2030: cond_true: Condition "!cimP", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2032: cond_true: Condition "i < nim->sy", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2034: cond_true: Condition "nim->pixels[i]", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2038: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gd_topal.c:2032: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gd_topal.c:2032: cond_true: Condition "i < nim->sy", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2034: cond_true: Condition "nim->pixels[i]", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2038: loop: Jumping back to the beginning of the loop
|
||||
gd-2.0.35/gd_topal.c:2032: loop_begin: Jumped back to beginning of loop
|
||||
gd-2.0.35/gd_topal.c:2032: cond_false: Condition "i < nim->sy", taking false branch
|
||||
gd-2.0.35/gd_topal.c:2038: loop_end: Reached end of loop
|
||||
gd-2.0.35/gd_topal.c:2039: cond_true: Condition "nim->pixels", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2044: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gd_topal.c:2047: if_end: End of if statement
|
||||
gd-2.0.35/gd_topal.c:2050: cond_true: Condition "i < (32 /* 1 << 5 */)", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2052: var_deref_op: Dereferencing null pointer "cquantize".
|
||||
|
||||
Error: FORWARD_NULL (CWE-476): [#def6]
|
||||
gd-2.0.35/gd_topal.c:1798: cond_true: Condition "cimP", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1801: cond_false: Condition "!nim", taking false branch
|
||||
gd-2.0.35/gd_topal.c:1803: if_end: End of if statement
|
||||
gd-2.0.35/gd_topal.c:1804: if_fallthrough: Falling through to end of if statement
|
||||
gd-2.0.35/gd_topal.c:1806: if_end: End of if statement
|
||||
gd-2.0.35/gd_topal.c:1807: cond_false: Condition "!oim->trueColor", taking false branch
|
||||
gd-2.0.35/gd_topal.c:1815: if_end: End of if statement
|
||||
gd-2.0.35/gd_topal.c:1819: cond_true: Condition "oim->transparent >= 0", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1823: cond_true: Condition "colorsWanted > maxColors", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1827: cond_false: Condition "!cimP", taking false branch
|
||||
gd-2.0.35/gd_topal.c:1842: if_end: End of if statement
|
||||
gd-2.0.35/gd_topal.c:1857: cond_true: Condition "!cquantize", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1857: var_compare_op: Comparing "cquantize" to null implies that "cquantize" might be null.
|
||||
gd-2.0.35/gd_topal.c:1860: goto: Jumping to label "outOfMemory"
|
||||
gd-2.0.35/gd_topal.c:2027: label: Reached label "outOfMemory"
|
||||
gd-2.0.35/gd_topal.c:2028: cond_true: Condition "oim->trueColor", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2030: cond_false: Condition "!cimP", taking false branch
|
||||
gd-2.0.35/gd_topal.c:2044: else_branch: Reached else branch
|
||||
gd-2.0.35/gd_topal.c:2050: cond_true: Condition "i < (32 /* 1 << 5 */)", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2052: var_deref_op: Dereferencing null pointer "cquantize".
|
||||
|
||||
Error: FORWARD_NULL (CWE-476): [#def7]
|
||||
gd-2.0.35/gd_topal.c:1798: cond_false: Condition "cimP", taking false branch
|
||||
gd-2.0.35/gd_topal.c:1804: else_branch: Reached else branch
|
||||
gd-2.0.35/gd_topal.c:1807: cond_false: Condition "!oim->trueColor", taking false branch
|
||||
gd-2.0.35/gd_topal.c:1815: if_end: End of if statement
|
||||
gd-2.0.35/gd_topal.c:1819: cond_true: Condition "oim->transparent >= 0", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1823: cond_true: Condition "colorsWanted > maxColors", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1827: cond_true: Condition "!cimP", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1829: cond_true: Condition "!nim->pixels", taking true branch
|
||||
gd-2.0.35/gd_topal.c:1829: var_compare_op: Comparing "nim->pixels" to null implies that "nim->pixels" might be null.
|
||||
gd-2.0.35/gd_topal.c:1832: goto: Jumping to label "outOfMemory"
|
||||
gd-2.0.35/gd_topal.c:2027: label: Reached label "outOfMemory"
|
||||
gd-2.0.35/gd_topal.c:2028: cond_true: Condition "oim->trueColor", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2030: cond_true: Condition "!cimP", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2032: cond_true: Condition "i < nim->sy", taking true branch
|
||||
gd-2.0.35/gd_topal.c:2034: var_deref_op: Dereferencing null pointer "nim->pixels".
|
||||
|
||||
|
||||
diff -up gd-2.0.35/gd_topal.c.sa4 gd-2.0.35/gd_topal.c
|
||||
--- gd-2.0.35/gd_topal.c.sa4 2012-12-10 13:30:19.666363149 +0100
|
||||
+++ gd-2.0.35/gd_topal.c 2012-12-10 13:37:50.550729535 +0100
|
||||
@@ -2029,15 +2029,15 @@ outOfMemory:
|
||||
{
|
||||
if (!cimP) {
|
||||
/* On failure only */
|
||||
- for (i = 0; i < nim->sy; i++)
|
||||
- {
|
||||
- if (nim->pixels[i])
|
||||
- {
|
||||
- gdFree (nim->pixels[i]);
|
||||
- }
|
||||
- }
|
||||
if (nim->pixels)
|
||||
{
|
||||
+ for (i = 0; i < nim->sy; i++)
|
||||
+ {
|
||||
+ if (nim->pixels[i])
|
||||
+ {
|
||||
+ gdFree (nim->pixels[i]);
|
||||
+ }
|
||||
+ }
|
||||
gdFree (nim->pixels);
|
||||
}
|
||||
nim->pixels = 0;
|
||||
@@ -2047,27 +2047,27 @@ outOfMemory:
|
||||
}
|
||||
}
|
||||
success:
|
||||
- for (i = 0; i < HIST_C0_ELEMS; i++)
|
||||
- {
|
||||
- if (cquantize->histogram[i])
|
||||
- {
|
||||
- gdFree (cquantize->histogram[i]);
|
||||
- }
|
||||
- }
|
||||
- if (cquantize->histogram)
|
||||
- {
|
||||
- gdFree (cquantize->histogram);
|
||||
- }
|
||||
- if (cquantize->fserrors)
|
||||
- {
|
||||
- gdFree (cquantize->fserrors);
|
||||
- }
|
||||
- if (cquantize->error_limiter_storage)
|
||||
- {
|
||||
- gdFree (cquantize->error_limiter_storage);
|
||||
- }
|
||||
if (cquantize)
|
||||
{
|
||||
+ for (i = 0; i < HIST_C0_ELEMS; i++)
|
||||
+ {
|
||||
+ if (cquantize->histogram[i])
|
||||
+ {
|
||||
+ gdFree (cquantize->histogram[i]);
|
||||
+ }
|
||||
+ }
|
||||
+ if (cquantize->histogram)
|
||||
+ {
|
||||
+ gdFree (cquantize->histogram);
|
||||
+ }
|
||||
+ if (cquantize->fserrors)
|
||||
+ {
|
||||
+ gdFree (cquantize->fserrors);
|
||||
+ }
|
||||
+ if (cquantize->error_limiter_storage)
|
||||
+ {
|
||||
+ gdFree (cquantize->error_limiter_storage);
|
||||
+ }
|
||||
gdFree (cquantize);
|
||||
}
|
||||
|
119
gd.spec
119
gd.spec
@ -1,29 +1,36 @@
|
||||
#global prever rc2
|
||||
%global commit 725ba9de4005144d137d2a7a70f760068fc3d306
|
||||
%global short %(c=%{commit}; echo ${c:0:7})
|
||||
|
||||
Summary: A graphics library for quick creation of PNG or JPEG images
|
||||
Name: gd
|
||||
Version: 2.0.35
|
||||
Release: 25%{?dist}
|
||||
Version: 2.1.0
|
||||
Release: 0.1.%{?prever}%{?short}%{?dist}
|
||||
Group: System Environment/Libraries
|
||||
License: MIT
|
||||
URL: http://www.libgd.org/Main_Page
|
||||
Source0: http://www.libgd.org/releases/%{name}-%{version}.tar.bz2
|
||||
Patch3: gd-2.0.34-multilib.patch
|
||||
Patch4: gd-loop.patch
|
||||
Patch5: gd-2.0.34-sparc64.patch
|
||||
Patch6: gd-2.0.35-overflow.patch
|
||||
Patch7: gd-2.0.35-AALineThick.patch
|
||||
Patch8: gd-2.0.33-BoxBound.patch
|
||||
Patch10: gd-2.0.35-time.patch
|
||||
Patch11: gd-2.0.35-security3.patch
|
||||
Patch12: gd-2.0.35-runtests.patch
|
||||
Patch13: gd-sa1.patch
|
||||
Patch14: gd-sa2.patch
|
||||
Patch15: gd-sa3.patch
|
||||
Patch16: gd-sa4.patch
|
||||
Patch17: gd-aarch64.patch
|
||||
BuildRequires: freetype-devel, fontconfig-devel, libX11-devel, libXpm-devel
|
||||
BuildRequires: libjpeg-devel, libpng-devel, zlib-devel, pkgconfig
|
||||
# we need cmake for building test suite
|
||||
BuildRequires: cmake, chrpath
|
||||
URL: http://libgd.bitbucket.org/
|
||||
%if 0%{?commit:1}
|
||||
# git clone git@bitbucket.org:libgd/gd-libgd.git; cd gd-libgd
|
||||
# git archive --format=tgz --output=libgd-2.1.0-$(git rev-parse master).tgz --prefix=libgd-2.1.0/ master
|
||||
Source0: libgd-%{version}-%{commit}.tgz
|
||||
%else
|
||||
Source0: https://bitbucket.org/libgd/gd-libgd/downloads/libgd-%{version}%{?prever:-%{prever}}.tar.xz
|
||||
%endif
|
||||
Patch1: gd-2.1.0-multilib.patch
|
||||
|
||||
BuildRequires: freetype-devel
|
||||
BuildRequires: fontconfig-devel
|
||||
BuildRequires: gettext-devel
|
||||
BuildRequires: libjpeg-devel
|
||||
BuildRequires: libpng-devel
|
||||
BuildRequires: libtiff-devel
|
||||
BuildRequires: libvpx-devel
|
||||
BuildRequires: libX11-devel
|
||||
BuildRequires: libXpm-devel
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: libtool
|
||||
|
||||
|
||||
%description
|
||||
The gd graphics library allows your code to quickly draw images
|
||||
@ -35,7 +42,7 @@ browsers. Note that gd is not a paint program.
|
||||
|
||||
|
||||
%package progs
|
||||
Requires: gd = %{version}-%{release}
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Summary: Utility programs that use libgd
|
||||
Group: Applications/Multimedia
|
||||
|
||||
@ -47,31 +54,33 @@ graphics library for creating PNG and JPEG images.
|
||||
%package devel
|
||||
Summary: The development libraries and header files for gd
|
||||
Group: Development/Libraries
|
||||
Requires: gd = %{version}-%{release}
|
||||
Requires: libX11-devel, libXpm-devel, libjpeg-devel, freetype-devel
|
||||
Requires: libpng-devel, zlib-devel, fontconfig-devel
|
||||
Requires: pkgconfig
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: freetype-devel%{?_isa}
|
||||
Requires: fontconfig-devel%{?_isa}
|
||||
Requires: libjpeg-devel%{?_isa}
|
||||
Requires: libpng-devel%{?_isa}
|
||||
Requires: libtiff-devel%{?_isa}
|
||||
Requires: libvpx-devel%{?_isa}
|
||||
Requires: libX11-devel%{?_isa}
|
||||
Requires: libXpm-devel%{?_isa}
|
||||
Requires: zlib-devel%{?_isa}
|
||||
|
||||
%description devel
|
||||
The gd-devel package contains the development libraries and header
|
||||
files for gd, a graphics library for creating PNG and JPEG graphics.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch3 -p1 -b .mlib
|
||||
%patch4 -p1 -b .loop
|
||||
%patch6 -p1 -b .overflow
|
||||
%patch5 -p1 -b .sparc64
|
||||
%patch7 -p1 -b .AALineThick
|
||||
%patch8 -p1 -b .bb
|
||||
%patch10 -p1 -b .time
|
||||
%patch11 -p1 -b .sec3
|
||||
%patch12 -p1 -b .runtests
|
||||
%patch13 -p1 -b .sa1
|
||||
%patch14 -p1 -b .sa2
|
||||
%patch15 -p1 -b .sa3
|
||||
%patch16 -p1 -b .sa4
|
||||
%patch17 -p1 -b .aarch64
|
||||
%setup -q -n libgd-%{version}%{?prever:-%{prever}}
|
||||
%patch1 -p1 -b .mlib
|
||||
|
||||
# (re)generate autotool stuff
|
||||
if [ -f configure ]; then
|
||||
autoreconf -fi
|
||||
else
|
||||
./bootstrap.sh
|
||||
fi
|
||||
|
||||
|
||||
%build
|
||||
# Provide a correct default font search path
|
||||
@ -82,33 +91,29 @@ CFLAGS="$RPM_OPT_FLAGS -DDEFAULT_FONTPATH='\"\
|
||||
/usr/share/X11/fonts/Type1:\
|
||||
/usr/share/fonts/liberation\"'"
|
||||
|
||||
%configure --disable-rpath
|
||||
%configure \
|
||||
--with-tiff=%{_prefix} \
|
||||
--disable-rpath
|
||||
make %{?_smp_mflags}
|
||||
|
||||
|
||||
%install
|
||||
make install INSTALL='install -p' DESTDIR=$RPM_BUILD_ROOT
|
||||
rm -f $RPM_BUILD_ROOT/%{_libdir}/libgd.la
|
||||
rm -f $RPM_BUILD_ROOT/%{_libdir}/libgd.a
|
||||
|
||||
# Using the last resort to remove rpath, another tricks didn't help
|
||||
chrpath --delete $RPM_BUILD_ROOT%{_bindir}/{pngtogd,gdparttopng,annotate,gdcmpgif,gdtopng,webpng,pngtogd2,gd2togif,gd2copypal,giftogd2,gd2topng}
|
||||
|
||||
%check
|
||||
pushd tests
|
||||
cmake -DBUILD_TEST=1 \
|
||||
-DGD_INCLUDE_DIR="`pwd`/.." \
|
||||
-DGD_LIBS_DIR="`pwd`/../.libs" \
|
||||
-DGD_SOURCE_DIR="`pwd`/.." .
|
||||
CPATH="`pwd`/gdtest" make
|
||||
make test
|
||||
popd
|
||||
make check
|
||||
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
|
||||
%files
|
||||
%doc COPYING README-JPEG.TXT index.html NEWS
|
||||
%doc COPYING
|
||||
%{_libdir}/*.so.*
|
||||
|
||||
%files progs
|
||||
@ -116,13 +121,17 @@ popd
|
||||
%exclude %{_bindir}/gdlib-config
|
||||
|
||||
%files devel
|
||||
%doc index.html
|
||||
%doc ChangeLog
|
||||
%{_bindir}/gdlib-config
|
||||
%{_includedir}/*
|
||||
%{_libdir}/*.so
|
||||
%{_libdir}/pkgconfig/gdlib.pc
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Jun 11 2013 Remi Collet <rcollet@redhat.com> - 2.1.0-0.1.725ba9d
|
||||
- update to 2.1.0 (post RC2 git snapshot)
|
||||
|
||||
* Tue Apr 23 2013 Remi Collet <rcollet@redhat.com> - 2.0.35-25
|
||||
- drop uneeded patch
|
||||
- really set default font search path
|
||||
|
Loading…
Reference in New Issue
Block a user