loop never executes

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

loop never executes

Post by el_supremo »

While trying to figure out how delegates work, I ran across this code in image.c/SetImageInfo():

Code: Select all

      /*
        Look for explicit image formats.
      */
      format_type=UndefinedFormatType;
      i=0;
      while ((format_type != UndefinedFormatType) &&
             (format_type_formats[i] != (char *) NULL))
      {
        if ((*magic == *format_type_formats[i]) &&
            (LocaleCompare(magic,format_type_formats[i]) == 0))
          format_type=ExplicitFormatType;
        i++;
      }
Since format_type is initialized to UndefinedFormatType, the first test in the while statement will immediately fail and the loop will never be executed.
I presume the first line of the while statement should be:

Code: Select all

      while ((format_type == UndefinedFormatType) &&
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: loop never executes

Post by magick »

We can reproduce the problem you reported and have a patch in ImageMagick 6.5.9-9 by sometime tomorrow. Thanks.
Post Reply