diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-12 19:26:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-12 19:26:35 +0300 |
commit | 4b4cb7f9c1e8be96618a75d8113da8a46fe81d48 (patch) | |
tree | 6b62b09346d65a0e78df0370d395d24c3c85ac5d /source/blender/editors | |
parent | 0e40d71fb05d763e4b70051610b34faeb71d31d9 (diff) |
bugfix [#21090] Crash because of slow USB drive
missing NULL check
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 9b3f6273025..f72699a5d7e 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4079,7 +4079,10 @@ static int imapaint_canvas_set(ImagePaintState *s, Image *ima) ImBuf *ibuf= BKE_image_get_ibuf(ima, s->sima? &s->sima->iuser: NULL); /* verify that we can paint and set canvas */ - if(ima->packedfile && ima->rr) { + if(ima==NULL) { + return 0; + } + else if(ima->packedfile && ima->rr) { s->warnpackedfile = ima->id.name + 2; return 0; } @@ -4087,7 +4090,7 @@ static int imapaint_canvas_set(ImagePaintState *s, Image *ima) s->warnmultifile = ima->id.name + 2; return 0; } - else if(!ima || !ibuf || !(ibuf->rect || ibuf->rect_float)) + else if(!ibuf || !(ibuf->rect || ibuf->rect_float)) return 0; s->image= ima; @@ -4410,7 +4413,7 @@ static int texture_paint_init(bContext *C, wmOperator *op) else { pop->s.image = pop->s.sima->image; - if(!imapaint_canvas_set(&pop->s, pop->s.sima->image)) { + if(!imapaint_canvas_set(&pop->s, pop->s.image)) { if(pop->s.warnmultifile) BKE_report(op->reports, RPT_WARNING, "Image requires 4 color channels to paint"); if(pop->s.warnpackedfile) |