From: Massimo Valentini Date: Sat, 14 Jul 2012 15:07:38 +0000 (+0200) Subject: babl: don't write anything if dest model lacks a source component X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~21^2~581 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ab431f17dc9714f996ec3c23dbaec3a2a21433e8;p=babl.git babl: don't write anything if dest model lacks a source component otherwise converting cairo-RGB24 to R'G'B' overwrites the red component with the PAD. --- diff --git a/babl/babl-fish-reference.c b/babl/babl-fish-reference.c index b00d67d..56eeb16 100644 --- a/babl/babl-fish-reference.c +++ b/babl/babl-fish-reference.c @@ -133,14 +133,14 @@ convert_to_double (BablFormat *source_fmt, { dst_img->data[0] = source_double_buf + (dst_img->type[0]->bits / 8) * j; + + babl_process (assert_conversion_find (src_img->type[0], + dst_img->type[0]), + src_img, dst_img, n); break; } } - babl_process ( - assert_conversion_find (src_img->type[0], dst_img->type[0]), - src_img, dst_img, - n); src_img->data[0] += src_img->type[0]->bits / 8; } babl_free (src_img); @@ -187,14 +187,14 @@ convert_from_double (BablFormat *destination_fmt, { src_img->data[0] = destination_double_buf + (src_img->type[0]->bits / 8) * j; + + babl_process (assert_conversion_find (src_img->type[0], + dst_img->type[0]), + src_img, dst_img, n); break; } } - babl_process ( - assert_conversion_find (src_img->type[0], dst_img->type[0]), - src_img, dst_img, - n); dst_img->data[0] += dst_img->type[0]->bits / 8; } babl_free (src_img);