pike.git / src / modules / Image / layers.c

version» Context lines:

pike.git/src/modules/Image/layers.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: layers.c,v 1.100 2008/01/16 19:42:57 grubba Exp $ + || $Id$   */      /*   **! module Image   **! class Layer   **! see also: layers   */      #include "global.h"   
pike.git/src/modules/Image/layers.c:2767: Inside #if defined(LAYERS_DUAL)
  #ifdef LAYERS_DUAL    rgb_group *line1,*aline1;    rgb_group *line2,*aline2;   #endif    rgb_group *d,*da;    int width=dest->xsize;    int y,z;    int xoffs=dest->xoffs,xsize=dest->xsize;      #ifdef LAYERS_DUAL -  line1=malloc(sizeof(rgb_group)*width); -  aline1=malloc(sizeof(rgb_group)*width); -  line2=malloc(sizeof(rgb_group)*width); -  aline2=malloc(sizeof(rgb_group)*width); +  line1=malloc(sizeof(rgb_group)*width + RGB_VEC_PAD); +  aline1=malloc(sizeof(rgb_group)*width + RGB_VEC_PAD); +  line2=malloc(sizeof(rgb_group)*width + RGB_VEC_PAD); +  aline2=malloc(sizeof(rgb_group)*width + RGB_VEC_PAD);    if (!line1 || !aline1    !line2 || !aline2)    {    if (line1) free(line1);    if (aline1) free(aline1);    if (line2) free(line2);    if (aline2) free(aline2); -  resource_error(NULL,0,0,"memory",sizeof(rgb_group)*4*width, +  resource_error(NULL,0,0,"memory",4*(sizeof(rgb_group)*width + RGB_VEC_PAD),    "Out of memory.\n");    }   #endif       da=dest->alp->img;    d=dest->img->img;       /* loop over lines */    for (y=0; y<dest->ysize; y++)    {