Avoid overflow in expression

This commit is contained in:
Mukund Sivaraman 2010-09-30 12:46:22 +05:30
parent ad331d5626
commit fee8f4008e
1 changed files with 4 additions and 6 deletions

View File

@ -323,12 +323,10 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
break;
case 'M': /* image size in megapixels */
{
i += print (title, title_len, i, "%.1f",
gimp_image_get_width (image) *
gimp_image_get_height (image) /
1000000.0f);
}
i += print (title, title_len, i, "%.1f",
(double) gimp_image_get_width (image) *
gimp_image_get_height (image) /
1000000.0);
break;
case 'l': /* number of layers */