Re: Crash on invalid XML profile
"Alexander E. Patrakov" <[email protected]> Sat, 3 Jan 2009 22:50:48 +0500
| Newsgroups | gmane.comp.video.image-magick.devel |
|---|---|
| Message-ID | <[email protected]> |
2009/1/3 <[email protected]>: >> Hello, this image causes the "identify" command to crash by attempting > > Thanks for the problem report and patch. We updated the ImageMagick > Subversion trunk and the fix will be available in the next point release. Sorry, but I am no longer sure that my fix is correct. Namely, what is the profile supposed to be set to on such invalid images? Currently, it is set to a string that begins with "http://". Should it be set at all? I.e., is this more correct than my original patch? --- coders/jpeg.c +++ coders/jpeg.c @@ -574,8 +574,13 @@ break; p++; } - if (*p == '\0') + if (i < (long) GetStringInfoLength(profile)) DestroyStringInfo(SplitStringInfo(profile,i+1)); + else + { + profile = DestroyStringInfo(profile); + return(MagickTrue); + } (void) CopyMagickString(name,"xmp",MaxTextExtent); } } -- Alexander E. Patrakov