dvipng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dvipng] dvipng crash in stringrgb function


From: Ahzo
Subject: Re: [Dvipng] dvipng crash in stringrgb function
Date: Wed, 3 Jul 2019 15:34:29 +0200 (CEST)

Hi,

Thanks for fixing the second crash, as well.

There's a third (and probably last) issue I've found with dvipng's handling of 
command-line parameters.
The problem can be reproduced as follows:
$ dvipng - --gamma 0.5
This is dvipng 1.15 Copyright 2002-2015 Jan-Ake Larsson
Segmentation fault

This is caused by a wrong format identifier for printf, using %s instead of %f 
for gamma, which is a double. The fix is simply:
--- a/misc.c
+++ b/misc.c
@@ -351,7 +351,7 @@ bool DecodeArgs(int argc, char ** argv)
            gamma=DEFAULT_GAMMA;
          }
          Gamma(gamma);
-         Message(PARSE_STDIN,"Gamma value is %s\n", gamma);
+         Message(PARSE_STDIN,"Gamma value is %f\n", gamma);
          break;
#ifdef HAVE_GDIMAGEGIF
        } else if (strncmp(p,"if",2)==0) { /* --gif output */

If you want to give credit, mentioning Ahzo is sufficient.

Best,
Ahzo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]