Fixed #21959 -- Handled Inf/NaN in widthratio tag.

Thanks rmoe for the report and the patch.