[Bf-committers] Patch 6395 Minor bug
in source/blender/blenkernel/intern/material.c
Campbell Barton
cbarton at metavr.com
Thu Mar 22 01:34:20 CET 2007
2 bugs that happened because of missing NULL checks with give_totcolp()
have been fixed in the last few days, Do you have a line number for the
crash?
Early Ehlinger wrote:
> Just yesterday I had a .blend file become corrupt using 2.43. Not sure
> exactly how that happened.
>
> Anyway, when I tried to open the .blend, Blender would print a warning
> that some data had been lost and then crash. It was an access violation
> reading 0x0000000, which I believe translates to segfault on Linux.
>
> So I fired up a debug build to see where it was happening.
>
> Turns out, it was source/blender/blenkernel/intern/material.c, inside
> give_current_material( )
>
> give_current_material() calls give_totcolp(), but doesn't check the
> result. In this case, presumably because the .blend file was somewhat
> corrupt, give_totcolp returned NULL, and give_current_material promptly
> dereferenced the pointer. WAMMO! Blender -> dead.
>
> Anyway, here's a patch to simply propagate the NULL return from
> give_totcolp up the chain, which was enough to allow me to recover the
> rest of the information from the .blend file.
>
> Unfortunately, I didn't think to keep the broken .blend to demonstrate
> the crash and the fix; I was so happy to have recovered it that I
> stupidly saved over the broken one with the recovered one.
>
> -- Early Ehlinger, President, ResPower, Inc.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
--
See MetaVR Visuals Used at the Combat Studies Institute
http://www.metavr.com/casestudies/baghdadviews.html
Campbell J Barton
133 Hope Street
Geelong West, Victoria 3218 Australia
URL: http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241
More information about the Bf-committers
mailing list