diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-01 13:17:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-01 13:17:31 +0300 |
commit | bfe2447f570ecc8b03a1ab3d3a1a1e4ed0b58312 (patch) | |
tree | efd8f10323b5f384e6388af45334c32b27cba5fa | |
parent | 2ada145fa46d9a91bd72e5a8884578bc5b8e8263 (diff) |
partial fix [#23265] matrix_world rna path is visible but returns 0 to drivers without error however accessed
this report raised a number of problems with rna paths, while we still dont have multi-dimensional array access, invalid paths were being accepted which confused things.
rna path resolving code was accepting all sorts of invalid input because atoi() just returns 0 for non numeric input.
now check if 0 number == '0' character.
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index d8c4c67c68a..9ec21b13695 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -3047,6 +3047,9 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, else { /* otherwise do int lookup */ intkey= atoi(token); + if(intkey==0 && (token[0] != '0' || token[1] != '\0')) { + return 0; /* we can be sure the fixedbuf was used in this case */ + } RNA_property_collection_lookup_int(&curptr, prop, intkey, &nextptr); } @@ -3096,6 +3099,9 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, else { /* otherwise do int lookup */ *index= atoi(token); + if(intkey==0 && (token[0] != '0' || token[1] != '\0')) { + return 0; /* we can be sure the fixedbuf was used in this case */ + } } } else { |