Skip to content
Permalink
Browse files

https://github.com//issues/105

  • Loading branch information...
Cristy
Cristy committed Jan 30, 2016
1 parent ec763d6 commit c4e63ad30bc42da691f2b5f82a24516dd6b4dc70
Showing with 7 additions and 4 deletions.
  1. +7 −4 MagickCore/quantum.c
@@ -304,6 +304,7 @@ MagickExport size_t GetQuantumExtent(const Image *image,
const QuantumInfo *quantum_info,const QuantumType quantum_type)
{
size_t
extent,
packet_size;

assert(quantum_info != (QuantumInfo *) NULL);
@@ -322,9 +323,10 @@ MagickExport size_t GetQuantumExtent(const Image *image,
case CMYKAQuantum: packet_size=5; break;
default: break;
}
extent=MagickMax(image->columns,image->rows);
if (quantum_info->pack == MagickFalse)
return((size_t) (packet_size*image->columns*((quantum_info->depth+7)/8)));
return((size_t) ((packet_size*image->columns*quantum_info->depth+7)/8));
return((size_t) (packet_size*extent*((quantum_info->depth+7)/8)));
return((size_t) ((packet_size*extent*quantum_info->depth+7)/8));
}

/*
@@ -683,8 +685,9 @@ MagickExport MagickBooleanType SetQuantumDepth(const Image *image,
if (quantum_info->pixels != (unsigned char **) NULL)
DestroyQuantumPixels(quantum_info);
quantum=(quantum_info->pad+6)*(quantum_info->depth+7)/8;
extent=image->columns*quantum;
if ((image->columns != 0) && (quantum != (extent/image->columns)))
extent=MagickMax(image->columns,image->rows)*quantum;
if ((MagickMax(image->columns,image->rows) != 0) &&
(quantum != (extent/MagickMax(image->columns,image->rows))))
return(MagickFalse);
return(AcquireQuantumPixels(quantum_info,extent));
}

0 comments on commit c4e63ad

Please sign in to comment.
You can’t perform that action at this time.