Fix #30064: Image editor: paint on image, rename image, undo -> crash
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 3 Feb 2012 20:12:21 +0000 (20:12 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 3 Feb 2012 20:12:21 +0000 (20:12 +0000)
source/blender/editors/sculpt_paint/paint_image.c

index a5b79d0c9741c83891de6e0034c5f37dceec4523..b8b36954e22b1b3f340913cbb9606f9e790c9a47 100644 (file)
@@ -474,7 +474,6 @@ static void image_undo_restore(bContext *C, ListBase *lb)
                }
 
                ibuf= BKE_image_get_ibuf(ima, NULL);
-               use_float = ibuf->rect_float ? 1 : 0;
 
                if(ima && ibuf && strcmp(tile->ibufname, ibuf->name)!=0) {
                        /* current ImBuf filename was changed, probably current frame
@@ -491,6 +490,8 @@ static void image_undo_restore(bContext *C, ListBase *lb)
                if (ima->gen_type != tile->gen_type || ima->source != tile->source)
                        continue;
 
+               use_float = ibuf->rect_float ? 1 : 0;
+
                if (use_float != tile->use_float)
                        continue;