[Bug 1492885] Re: Practically-infinite loop in MagickCore/image.c - SetImageBackgroundColor

Moshe Kaplan mk.moshe.kaplan at gmail.com
Mon Sep 7 04:15:41 UTC 2015


https://github.com/ImageMagick/ImageMagick/issues/27

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to imagemagick in Ubuntu.
https://bugs.launchpad.net/bugs/1492885

Title:
  Practically-infinite loop in MagickCore/image.c -
  SetImageBackgroundColor

Status in imagemagick package in Ubuntu:
  New

Bug description:
  SetImageBackgroundColor contains the following loop:

  for (y=0; y < (ssize_t) image->rows; y++)
    {
      register Quantum
        *restrict q;

      register ssize_t
        x;

      if (status == MagickFalse)
        continue;
      q=QueueCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
      if (q == (Quantum *) NULL)
        {
          status=MagickFalse;
          continue;
        }
      for (x=0; x < (ssize_t) image->columns; x++)
      {
        SetPixelViaPixelInfo(image,&background,q);
        q+=GetPixelChannels(image);
      }
      if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
        status=MagickFalse;
    }

  this means it can execute the inner loop 2^31 times for each valid
  row, for a potential maximum of 2^62 iterations.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/1492885/+subscriptions



More information about the foundations-bugs mailing list