aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/jpeg/rgba32.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/jpeg/rgba32.c')
-rw-r--r--com32/lib/jpeg/rgba32.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/com32/lib/jpeg/rgba32.c b/com32/lib/jpeg/rgba32.c
index da08344d..d04f0f13 100644
--- a/com32/lib/jpeg/rgba32.c
+++ b/com32/lib/jpeg/rgba32.c
@@ -364,12 +364,12 @@ static int initialize_rgba32(struct jdec_private *priv,
unsigned int *bytes_per_blocklines,
unsigned int *bytes_per_mcu)
{
- if (priv->components[0] == NULL)
- priv->components[0] = (uint8_t *)malloc(priv->width * priv->height * 4);
if (!priv->bytes_per_row[0])
priv->bytes_per_row[0] = priv->width * 4;
+ if (!priv->components[0])
+ priv->components[0] = malloc(priv->height * priv->bytes_per_row[0]);
- bytes_per_blocklines[0] = priv->bytes_per_row[0];
+ bytes_per_blocklines[0] = priv->bytes_per_row[0] << 3;
bytes_per_mcu[0] = 4*8;
return !priv->components[0];