From 7331793b951e0ab9cbb8107ecefc9aabc8aaf986 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Thu, 4 Nov 2010 16:31:50 +0000 Subject: Properly initialise and finalise {Image,Graphics}Magick context. --HG-- extra : rebase_source : 97225919cd1c6c2327ccbb43b17a6b049e82946c --- src/libxinevdec/image.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c index 2c19d36fb..d5a9cfff5 100644 --- a/src/libxinevdec/image.c +++ b/src/libxinevdec/image.c @@ -101,12 +101,14 @@ static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { /* * this->image -> rgb data */ + InitializeMagick(NULL); wand = NewMagickWand(); status = MagickReadImageBlob(wand, this->image, this->index); this->index = 0; if (!status) { DestroyMagickWand(wand); + DestroyMagick(); lprintf("error loading image\n"); return; } @@ -116,6 +118,7 @@ static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { img_buf = malloc(width * height * 3); MagickGetImagePixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf); DestroyMagickWand(wand); + DestroyMagick(); _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, width); _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, height); -- cgit v1.2.3