Bug with texture file names in Collada Importer (ColladaLoader::ConvertPath)

  • mike morrison
    mike morrison
    2013-12-10

    The ColladaLoader::ConvertPath function does not work properly for certain files with special characters.

    The offending code is at line 1452 of ColladaLoader.cpp (of the version 3.0 release).

    Consider the following example:

    "Texture%2032.png"

    %20 should be replaced with a space, but the ConvertPath function uses strtoul16 to convert the hex string to a number without limiting it to two characters. It then ands it with 0xFF and converts back to a string. So 2032 & 0xFF = '\32'.

    Actual result:

    "Texture2.png"

    Expected result:

    "Texture 32.png"