summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-05-22 15:36:32 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-05-22 16:05:21 +0200
commit7cafb7553342c61d44c83cbcc22bdae5817d10fe (patch)
treea638451857a709173f5bf20c479c335d8d553dea /external
parentfaa9a681e730e5028c5fefa90938726ff9abe31d (diff)
opencollada: uninitialized bool variable broke the parsing
GeneratedSaxParser::Utils:toURI() method has a bool output parameter called failed, which is assumed to be set inside the method before return. At some place the caller code does not initialize the bool variable passed to this failed parameter and so when the caller checkes the returned value it is undefined. e.g. it can be false when the method called successfully so the error handling throws away the returned URI. Change-Id: I3f90fab657a86b42bba0f492518e36c343e69d21
Diffstat (limited to 'external')
-rw-r--r--external/opencollada/UnpackedTarball_opencollada.mk1
-rw-r--r--external/opencollada/generatedsaxparser_utils_touri_fix.patch.135
2 files changed, 36 insertions, 0 deletions
diff --git a/external/opencollada/UnpackedTarball_opencollada.mk b/external/opencollada/UnpackedTarball_opencollada.mk
index 579efc25494d..487a858c937e 100644
--- a/external/opencollada/UnpackedTarball_opencollada.mk
+++ b/external/opencollada/UnpackedTarball_opencollada.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,opencollada,$(OPENCOLLADA_TARBALL))
$(eval $(call gb_UnpackedTarball_add_patches,opencollada,\
external/opencollada/opencollada.clang.patch.0 \
external/opencollada/opencollada.libxml.patch.0 \
+ external/opencollada/generatedsaxparser_utils_touri_fix.patch.1 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/opencollada/generatedsaxparser_utils_touri_fix.patch.1 b/external/opencollada/generatedsaxparser_utils_touri_fix.patch.1
new file mode 100644
index 000000000000..892d4b93020d
--- /dev/null
+++ b/external/opencollada/generatedsaxparser_utils_touri_fix.patch.1
@@ -0,0 +1,35 @@
+diff -ur opencollada.org/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp opencollada/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
+--- opencollada.org/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp 2014-05-22 15:24:25.437939696 +0200
++++ opencollada/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp 2014-05-22 15:24:50.769938623 +0200
+@@ -865,13 +865,14 @@
+ {
+ if ( *buffer == bufferEnd )
+ {
+- failed = false;
++ failed = true;
+ return COLLADABU::URI(0);
+ }
+ //Just get the string as it is for ids, so that we are able to read FBX-COLLADA
+ //Otherwise, calling toStringItem would result in a truncated string when an id contains spaces
+ //const ParserString& string = toStringListItem(buffer, bufferEnd, failed);
+ //return COLLADABU::URI(string.str, string.length);
++ failed = false;
+ return COLLADABU::URI((const char*)*buffer, bufferEnd - *buffer);
+ }
+
+@@ -880,13 +881,14 @@
+ {
+ if ( **buffer == '\0' )
+ {
+- failed = false;
++ failed = true;
+ return COLLADABU::URI(0);
+ }
+ //Just get the string as it is for ids, so that we are able to read FBX-COLLADA
+ //Otherwise, calling toStringItem would result in a truncated string when an id contains spaces
+ //const ParserString& string = toStringListItem(buffer, failed);
+ //return COLLADABU::URI(string.str, string.length);
++ failed = false;
+ return COLLADABU::URI((const char*)*buffer);
+ }
+