summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2010-11-04 16:31:50 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2010-11-04 16:31:50 +0000
commit7331793b951e0ab9cbb8107ecefc9aabc8aaf986 (patch)
tree781c02d2d8e45ac0b7b6e4f75befc41f677b262b
parentfc6102b1ecb5d5205cbdab646720c0b7cd9ed825 (diff)
downloadxine-lib-7331793b951e0ab9cbb8107ecefc9aabc8aaf986.tar.gz
xine-lib-7331793b951e0ab9cbb8107ecefc9aabc8aaf986.tar.bz2
Properly initialise and finalise {Image,Graphics}Magick context.
--HG-- extra : rebase_source : 97225919cd1c6c2327ccbb43b17a6b049e82946c
-rw-r--r--src/libxinevdec/image.c3
1 files changed, 3 insertions, 0 deletions
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);