Revision: 26579
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26579
Author:   aligorith
Date:     2010-02-03 12:53:57 +0100 (Wed, 03 Feb 2010)

Log Message:
-----------
Bugfix #20586: Selecting "Straight Line" from Grease Pencil crashes in UV image 
editor

This commit adds a check that should prevent crashes of the kind that were 
occurring in the report description from happening. 

However, I couldn't verify yet whether this really works, since it appears the 
bug has temporarily disappeared in recent svn. Just in case, I've committed 
this fix, and we can revert/improve if the bug returns.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/gpencil/gpencil_paint.c

Modified: trunk/blender/source/blender/editors/gpencil/gpencil_paint.c
===================================================================
--- trunk/blender/source/blender/editors/gpencil/gpencil_paint.c        
2010-02-03 11:43:26 UTC (rev 26578)
+++ trunk/blender/source/blender/editors/gpencil/gpencil_paint.c        
2010-02-03 11:53:57 UTC (rev 26579)
@@ -1456,6 +1456,16 @@
                        }
                        else {
                                /* not painting, so start stroke (this should 
be mouse-button down) */
+                               
+                               /* we must check that we're still within the 
area that we're set up to work from
+                                * otherwise we could crash (see bug #20586)
+                                */
+                               if (CTX_wm_area(C) != p->sa) {
+                                       //printf("\t\t\tGP - wrong area 
execution abort! \n");
+                                       gpencil_draw_exit(C, op);
+                                       return OPERATOR_CANCELLED;
+                               }
+                                
                                //printf("\t\tGP - start stroke \n");
                                p->status= GP_STATUS_PAINTING;
                                /* no break now, since we should immediately 
start painting */


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to