diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-25 15:06:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-25 15:06:30 +0400 |
commit | 1f1481841de3bb804508e11fe719eb7d0a0caddd (patch) | |
tree | a4e97855e0a6c0252b648f1692f4339488c7eb80 /source/blender/imbuf | |
parent | 49ad7345af5d7168423cfe5675fbfdfd5b86d04c (diff) |
fix [#27478] Crash on image editor after loading exr images
patch from Ryakiotakis Antonis (psy-fi) with minor change.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/scaling.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index f6a6a644977..5389d90867e 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -300,17 +300,18 @@ void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1) uchar *p1, *p2 = NULL, *dest; float *p1f, *destf, *p2f = NULL; int x,y; - int do_rect, do_float; + const short do_rect= (ibuf1->rect != NULL); + const short do_float= (ibuf1->rect_float != NULL) && (ibuf2->rect_float != NULL); + + if(do_rect && (ibuf2->rect == NULL)) { + imb_addrectImBuf(ibuf2); + } - do_rect= (ibuf1->rect != NULL); - p1f = ibuf1->rect_float; destf=ibuf2->rect_float; p1 = (uchar *) ibuf1->rect; dest=(uchar *) ibuf2->rect; - do_float= (ibuf1->rect_float != NULL && ibuf2->rect_float != NULL); - for(y=ibuf2->y;y>0;y--){ if (do_rect) p2 = p1 + (ibuf1->x << 2); if (do_float) p2f = p1f + (ibuf1->x << 2); |