block /0 in unpremultiply

This commit is contained in:
John Cupitt 2019-08-04 14:01:42 +01:00
parent 64d42be091
commit f472df4444
1 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ G_DEFINE_TYPE( VipsUnpremultiply, vips_unpremultiply, VIPS_TYPE_CONVERSION );
IN clip_alpha = VIPS_CLIP( 0, alpha, max_alpha ); \
OUT nalpha = (OUT) clip_alpha / max_alpha; \
\
if( clip_alpha == 0 ) \
if( nalpha == 0 ) \
for( i = 0; i < bands - 1; i++ ) \
q[i] = 0; \
else \
@ -104,7 +104,7 @@ G_DEFINE_TYPE( VipsUnpremultiply, vips_unpremultiply, VIPS_TYPE_CONVERSION );
IN clip_alpha = VIPS_CLIP( 0, alpha, max_alpha ); \
OUT nalpha = (OUT) clip_alpha / max_alpha; \
\
if( clip_alpha == 0 ) { \
if( nalpha == 0 ) { \
q[0] = 0; \
q[1] = 0; \
q[2] = 0; \