Based on a patch from the submitter. PR: 46329 Submitted by: Hidenori Ishikawa <hideishi@magisystem.net>