Bugfix #24699
authorTon Roosendaal <ton@blender.org>
Sat, 4 Dec 2010 12:33:45 +0000 (12:33 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 4 Dec 2010 12:33:45 +0000 (12:33 +0000)
Crash when deleting Shapekeys, while Graph or Dopesheet was visible.
Caused by RNA collection lookup, which is not checking against index
out of range errors.

Brecht might have to give blessings for this though :)

source/blender/makesrna/intern/makesrna.c

index 903c769877f30c3345f55c1fcac7c8a5ee02ff87..f454cb8f2319dd30358b8199764214541e02857b 100644 (file)
@@ -918,7 +918,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
                fprintf(f, "                    }\n");
                fprintf(f, "            }\n");
                fprintf(f, "            else {\n");
-               fprintf(f, "                    while(index-- > 0)\n");
+               fprintf(f, "                    while(index-- > 0 && internal->link)\n");
                fprintf(f, "                            internal->link= internal->link->next;\n");
                fprintf(f, "            }\n");
        }