diff options
author | Jens Ole Wund <bjornmose@gmx.net> | 2006-02-11 02:47:40 +0300 |
---|---|---|
committer | Jens Ole Wund <bjornmose@gmx.net> | 2006-02-11 02:47:40 +0300 |
commit | c85abd748f652dccda6ed5ebf6f9f631a87bafc5 (patch) | |
tree | e50dfbc4254280e90285a3d0950801a40802ce78 /source/blender/src/interface_icons.c | |
parent | ee4c7ef22aa95a4d1bb6ab4079576009862611d0 (diff) |
i have a file running into this check causing a 'hang' without
may be it's a development hick up .. still i think that error trap should be there
Diffstat (limited to 'source/blender/src/interface_icons.c')
-rw-r--r-- | source/blender/src/interface_icons.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/src/interface_icons.c b/source/blender/src/interface_icons.c index fd9ea289f9e..9ec60571fb7 100644 --- a/source/blender/src/interface_icons.c +++ b/source/blender/src/interface_icons.c @@ -751,6 +751,10 @@ void BIF_icon_draw(float x, float y, int icon_id) /* di->rect contains image in 'rendersize', we only scale if needed */ else if(di->rw!=di->w && di->rh!=di->h) { ImBuf *ima; + if(di->w>2000 || di->h>2000) { /* something has gone wrong! */ + printf("insane icon size di->w %d di->h %d\n",di->w,di->h); + return; + } /* first allocate imbuf for scaling and copy preview into it */ ima = IMB_allocImBuf(di->rw, di->rh, 32, IB_rect, 0); memcpy(ima->rect, di->rect, di->rw*di->rh*sizeof(unsigned int)); |