]> granicus.if.org Git - imagemagick/commitdiff
Bug fix on segv in not CLI apis (image->image_info pointer)
authoranthony <anthony@git.imagemagick.org>
Wed, 14 Nov 2012 05:22:17 +0000 (05:22 +0000)
committeranthony <anthony@git.imagemagick.org>
Wed, 14 Nov 2012 05:22:17 +0000 (05:22 +0000)
MagickCore/image.c
MagickCore/property.c
Makefile.in
tests/Makefile.am

index cea00680fd88633f069c4a1f8ea987b583c7d9bc..aa7eda79ffaf5f2298caeef63f2060b150a46c42 100644 (file)
@@ -3962,7 +3962,13 @@ MagickExport MagickBooleanType SyncImageSettings(const ImageInfo *image_info,
      WARNING: when a global option is set or unset, any equivelent per-image
      artefact should also be unset.
   */
-  image->image_info = image_info;
+  /* Programming Note...
+     Don't do anything at this point, as image_info is only being used
+     to create the image, the image may not be added to this image_info,
+     or in some API's to any specific image_info structure.
+  */
+  /* image->image_info = image_info; */
+  image->image_info = (MagickInfo *) NULL;
 #endif
   return(MagickTrue);
 }
index be64e02406b38d3c5231db2556c15b282bb2fa6c..05ca1c529030e2794ae5a886c2534f4a238af45f 100644 (file)
@@ -3454,6 +3454,8 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
 
   switch (*property)
   {
+#if 0  /* the percent escape sets prefix:... propertys!
+          This causes it to fail */
     case '8':
     {
       if (LocaleNCompare("8bim:",property,5) == 0)
@@ -3464,6 +3466,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
         }
       break;
     }
+#endif
     case 'B':
     case 'b':
     {
@@ -3611,6 +3614,8 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
         }
       break; /* add to properties splay tree */
     }
+#if 0  /* the percent escape sets prefix:... propertys!
+          This causes it to fail */
     case 'E':
     case 'e':
     {
@@ -3633,6 +3638,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
         }
       break; /* add to properties splay tree */
     }
+#endif
     case 'G':
     case 'g':
     {
@@ -3692,12 +3698,15 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           image->interpolate=(PixelInterpolateMethod) interpolate;
           return(MagickTrue);
         }
+#if 0  /* the percent escape sets prefix:... propertys!
+          This causes it to fail */
       if (LocaleNCompare("iptc:",property,5) == 0)
         {
           (void) ThrowMagickException(exception,GetMagickModule(),
                OptionError,"SetReadOnlyProperty","'%s'",property);
           return(MagickFalse);
         }
+#endif
       break; /* add to properties splay tree */
     }
     case 'K':
@@ -3754,12 +3763,15 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           geometry=DestroyString(geometry);
           return(MagickTrue);
         }
+#if 0  /* the percent escape sets prefix:... propertys!
+          This causes it to fail */
       if (LocaleNCompare("pixel:",property,6) == 0)
         {
           (void) ThrowMagickException(exception,GetMagickModule(),
                OptionError,"SetReadOnlyProperty","'%s'",property);
           return(MagickFalse);
         }
+#endif
       if (LocaleCompare("profile",property) == 0)
         {
           ImageInfo
@@ -3861,6 +3873,8 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
         }
       break; /* add to properties splay tree */
     }
+#if 0  /* the percent escape sets prefix:... propertys!
+          This causes it to fail */
     case 'X':
     case 'x':
     {
@@ -3872,8 +3886,9 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
         }
       break; /* add to properties splay tree */
     }
+#endif
   }
-  /* add to properties splay tree */
+  /* Default: add to properties splay tree */
   status=AddValueToSplayTree((SplayTreeInfo *) image->properties,
     ConstantString(property),ConstantString(value));
   /* FUTURE: error if status is bad? */
index 550880a1cacb8bdd3aaf762f6c052b4e5f2f4f69..95e4332050f86705c9b6d92cd6fad5a03b060141 100644 (file)
@@ -4800,13 +4800,13 @@ TESTS_TESTS = \
        tests/validate-identify.tap \
        tests/validate-import.tap \
        tests/validate-montage.tap \
-       tests/validate-pipe.tap \
-       tests/validate-colorspace.tap \
        tests/validate-stream.tap \
        tests/validate-formats-in-memory.tap \
        tests/validate-formats-on-disk.tap \
        tests/drawtest.tap \
-       tests/wandtest.tap
+       tests/wandtest.tap \
+       tests/cli-colorspace.tap \
+       tests/cli-pipe.tap
 
 TESTS_EXTRA_DIST = \
        tests/common.shi \
index 2e25c61bf664782a88fea437e9662fd8b011772c..7196f6ae50b630e9a88ab39f2d6002e276d95599 100644 (file)
@@ -40,13 +40,13 @@ TESTS_TESTS = \
        tests/validate-identify.tap \
        tests/validate-import.tap \
        tests/validate-montage.tap \
-       tests/validate-pipe.tap \
-       tests/validate-colorspace.tap \
        tests/validate-stream.tap \
        tests/validate-formats-in-memory.tap \
        tests/validate-formats-on-disk.tap \
        tests/drawtest.tap \
        tests/wandtest.tap
+       tests/cli-colorspace.tap \
+       tests/cli-pipe.tap \
 
 TESTS_EXTRA_DIST = \
        tests/common.shi \