Bug in mspaint.exe found

  • Thread starter Thread starter mdjr
  • Start date Start date
M

mdjr

Hello.

I found a bug in MSPAINT.EXE. A MS employee told me to post it here but I do
not know if this forum is the correct one:

When starting MS Paint the program will calculate the display resolution
using the following formula:
pixels_per_meter_X = 1000*screen_width_in_pixels/screen_width_in_millimeters
The same is done for the Y-Direction.

Unfortunately in some cases (in my case I had a video projector connected to
my Laptop) the GetDeviceCaps() function returns a screen width and height of
0 millimeters. This will cause the mspaint.exe application to crash because
of a division-by-zero exception.

My suggestion is to change mspaint.exe the following way:
if(screen_width_in_millimeters>MINIMUM_WIDTH)
pixels_per_meter_X = ...
else pixels_per_meter_X = DEFAULT_RES;

The bug occurred in Windows XP but a look at the disassembly of mspaint.exe
in Windows Vista showed that it is also present in Windows Vista.

Martin
 
I don't know how many people would be using a projector to use/draw in
MSpaint. Also not sure if all projectors being used like this would be
returning a zero to cause that devide by zero error. It would be interesting
to do a repro of the issue though, will try it today.

Do you have a user dump of the mspaint process for reviewing.

Your MS friend would have known a better forum to have the issue addressed,
this may not be the right forum to submit such a bug.
 
Back
Top