tmx: fix warning: may be used uninitialized in this function

(cherry picked from commit 022ae9be87b11838345a3d22b1170b280aef8aa7)