#include "BLI_blenlib.h"
+#include "BLI_utildefines.h"
#include "MEM_guardedalloc.h"
#include "imbuf.h"
float *rectf, *_newrectf, *newrectf;
float sample, add, val[4], nval[4], valf[4], nvalf[4];
int x, y, do_rect = 0, do_float = 0;
+ uchar *rect_end;
+ float *rectf_end;
+
rectf= _newrectf= newrectf= NULL;
rect=_newrect= newrect= NULL;
do_rect = 1;
_newrect = MEM_mallocN(newx * ibuf->y * sizeof(int), "scaledownx");
if (_newrect==NULL) return(ibuf);
+ rect_end= (unsigned char *)ibuf->rect + (ibuf->x * ibuf->y * sizeof(int));
}
if (ibuf->rect_float) {
do_float = 1;
if (_newrect) MEM_freeN(_newrect);
return(ibuf);
}
+ rectf_end= ibuf->rect_float + (ibuf->x * ibuf->y * sizeof(float) * 4);
}
add = (ibuf->x - 0.001) / newx;
}
if (do_rect) {
+ BLI_assert(rect == rect_end); /* see bug [#26502] */
imb_freerectImBuf(ibuf);
ibuf->mall |= IB_rect;
ibuf->rect = (unsigned int *) _newrect;
}
if (do_float) {
+ BLI_assert(rectf == rectf_end); /* see bug [#26502] */
imb_freerectfloatImBuf(ibuf);
ibuf->mall |= IB_rectfloat;
ibuf->rect_float = _newrectf;
float *rectf, *_newrectf, *newrectf;
float sample, add, val[4], nval[4], valf[4], nvalf[4];
int x, y, skipx, do_rect = 0, do_float = 0;
+ uchar *rect_end;
+ float *rectf_end;
rectf= _newrectf= newrectf= NULL;
rect= _newrect= newrect= NULL;
do_rect = 1;
_newrect = MEM_mallocN(newy * ibuf->x * sizeof(int), "scaledowny");
if (_newrect==NULL) return(ibuf);
+ rect_end= (unsigned char *)ibuf->rect + (ibuf->x * ibuf->y * sizeof(int));
}
if (ibuf->rect_float) {
do_float = 1;
if (_newrect) MEM_freeN(_newrect);
return(ibuf);
}
+ rectf_end= ibuf->rect_float + (ibuf->x * ibuf->y * sizeof(float) * 4);
}
add = (ibuf->y - 0.001) / newy;
}
if (do_rect) {
+ BLI_assert(rect == rect_end); /* see bug [#26502] */
imb_freerectImBuf(ibuf);
ibuf->mall |= IB_rect;
ibuf->rect = (unsigned int *) _newrect;
}
if (do_float) {
+ BLI_assert(rectf == rectf_end); /* see bug [#26502] */
imb_freerectfloatImBuf(ibuf);
ibuf->mall |= IB_rectfloat;
ibuf->rect_float = (float *) _newrectf;