diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 81e2b1caea2..f72699a5d7e 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. @@ -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) |