silence error: 'mat' may be used uninitialized in this function

silence error: 'mat' may be used uninitialized in this function [-Werror=maybe-uninitialized]