Package: libmagick++9c2a
Version: 7:6.2.4.5.dfsg1-0.14
Severity: normal
Short program which the creates the problem: -
==============
// To compile use g++ `Magick++-config --ldflags --libs`
#include <list>
#include <Magick++.h>
#include <errno.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <signal.h>
using namespace Magick;
using namespace std;
const unsigned char testImage[] =
{ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, //10
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0e, 0x08, 0x03, 0x00, 0x00,
0x00, 0x11, 0xf1, 0x6c, //20
0xb8, 0x00, 0x00, 0x00, 0x03, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08,
0xdb, 0xe1, 0x4f, 0xe0, //30
0x00, 0x00, 0x00, 0x42, 0x50, 0x4c, 0x54, 0x45, 0xff, 0xff, 0xff, 0x33,
0x66, 0x99, 0x33, 0x66, //40
0x99, 0x33, 0x66, 0x99, 0x33, 0x66, 0x99, 0x33, 0x66, 0x99, 0x33, 0x66,
0x99, 0x33, 0x66, 0x99, //50
0x33, 0x66, 0x99, 0x33, 0x66, 0x99, 0x33, 0x66, 0x99, 0x33, 0x66, 0x99,
0x33, 0x66, 0x99, 0x33, //60
0x66, 0x99, 0x33, 0x66, 0x99, 0xe5, 0xeb, 0xf2, 0xd9, 0xe2, 0xec, 0xbf,
0xcf, 0xdf, 0xa6, 0xbc, //70
0xd3, 0x99, 0xb3, 0xcc, 0x81, 0xa1, 0xc0, 0x33, 0x66, 0x99, 0xad, 0x6c,
0x14, 0xf5, 0x00, 0x00, //80
0x00, 0x16, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
0x66, 0x77, 0x88, 0x99, //90
0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xf5, 0x40, 0x52, 0xec, //a0
0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x12,
0x00, 0x00, 0x0b, 0x12, //b0
0x01, 0xd2, 0xdd, 0x7e, 0xfc, 0x00, 0x00, 0x00, 0x1f, 0x74, 0x45, 0x58,
0x74, 0x53, 0x6f, 0x66, //c0
0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x4d, 0x61, 0x63, 0x72, 0x6f, 0x6d,
0x65, 0x64, 0x69, 0x61, //d0
0x20, 0x46, 0x69, 0x72, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x20, 0x38,
0xb5, 0x68, 0xd2, 0x78, //e0
0x00, 0x00, 0x00, 0x72, 0x49, 0x44, 0x41, 0x54, 0x08, 0x99, 0x55, 0x8e,
0x5b, 0x12, 0x83, 0x30, //f0
0x08, 0x45, 0x09, 0x28, 0x41, 0x12, 0xb4, 0x0f, 0xd9, 0xff, 0x56, 0x0b,
0xa9, 0x19, 0xdb, 0xf3, //100
0x77, 0x0f, 0x8f, 0xb9, 0x00, 0x03, 0x5a, 0x99, 0x17, 0xb8, 0x89, 0x88,
0xc0, 0x5c, 0x66, 0x26, //110
0x8e, 0xf9, 0x72, 0xef, 0x20, 0x0b, 0x0f, 0xbe, 0x02, 0x37, 0x55, 0x6d,
0xc2, 0x78, 0x1d, 0x60, //120
0xc4, 0xe3, 0xe8, 0xd6, 0x36, 0xc1, 0x21, 0x6a, 0x88, 0xf3, 0xdc, 0xdd,
0x5f, 0x6f, 0x97, 0x14, //130
0x9a, 0x74, 0x77, 0x7f, 0x3c, 0xdd, 0xf9, 0x57, 0x24, 0x76, 0x9d, 0x68,
0x86, 0xbd, 0xd5, 0x35, //140
0xbf, 0x94, 0x29, 0x9c, 0x66, 0x0b, 0x51, 0xb5, 0xb1, 0x32, 0x0d, 0x14,
0xa2, 0xfe, 0x6f, 0xc2, //150
0x55, 0x73, 0xab, 0x59, 0xed, 0x03, 0x74, 0xa0, 0x06, 0x51, 0xd3, 0xaf,
0xbb, 0x7b, 0x00, 0x00, //160
0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; //16a
const unsigned long testImageLength = 0x16a;
int main(int argc, const char* argv[])
{
// Copy the image Data to an ImageMagick object
Blob magickBlob(testImage, testImageLength);
//
// Get the first frame if this is an animation
list<Image> imageList;
readImages(&imageList, magickBlob);
// Check that there is at least one image in the image list.
if ( imageList.empty() )
{
exit(0);
}
else
{
// Just get the first one
Image &magickImage = imageList.front();
// Remove comment
magickImage.comment("");
unsigned int coloursTo = 8;
magickImage.quality(100);
magickImage.quantizeColors(coloursTo);
magickImage.quantizeDither(false);
magickImage.quantizeColorSpace(YIQColorspace);
magickImage.quantize();
// Output the image back to the place where data came in.
magickImage.write(&magickBlob);
int outputLength = magickBlob.length();
}
}
====
Running the above on debian etch with libmagick++-9c2a gives a segmentation
violation
like this: -
====
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db library
"/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program:
/export/personal/chrisg/JOBS/4.1/Code/Common/Optimisation/a.out
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1219659136 (LWP 8211)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1219659136 (LWP 8211)]
0xb754a709 in free () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0xb754a709 in free () from /lib/tls/i686/cmov/libc.so.6
#1 0xb7c7a011 in RelinquishMagickMemory () from /usr/lib/libMagick.so.9
#2 0xb7bace0f in ImageToBlob () from /usr/lib/libMagick.so.9
#3 0xb7f8e09c in Magick::Image::write () from /usr/lib/libMagick++.so.9
#4 0x080490e3 in main ()
(gdb) quit
====
Running the same program on a sarge installation with libmagick++6 works as
expected.
I did see somewhere on the web that RGBA PNGS are meant to be 8 or 16 bit
colordepth,
so I tried changing the coloursTo value to be 256 and 65536 for two more runs,
both of
which crashed on etch.
I'm guessing it's a disagreement between imagemagick and soem errors in the
image - if
the library just threw an error that would be fine, as I could catch that and
handle it
though the segmentation violation just causes my program to bomb out :-(.
-- System Information:
Debian Release: 4.0
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-5-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Versions of packages libmagick++9c2a depends on:
ii libc6 2.3.6.ds1-13etch2 GNU C Library: Shared libraries
ii libfreetype6 2.2.1-5+etch1 FreeType 2 font engine, shared lib
ii libgcc1 1:4.1.1-21 GCC support library
ii libmagick9 7:6.2.4.5.dfsg1-0.14 Image manipulation library
ii libstdc++6 4.1.1-21 The GNU Standard C++ Library v3
ii zlib1g 1:1.2.3-13 compression library - runtime
libmagick++9c2a recommends no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]