winmm: Handle GetTickCount overflow in MIDI player.

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Thu Feb 14 05:58:03 CST 2013


Hi,

after reading the SafeInt integer overflow & signedness issues paper I had very bad feelings.

I reviewed a few uses of GetTickCount in Wine
- DSound not reviewed
- winmm time -- hard to tell, involves signed integers as well
- winealsa ok (pass through to slot mTime)
- winmm & mciseq share the same bug in MIDI, here's a fix for winmm.

I feel very uncomfortable about the overflow&sign issue. I think it's something where you really
need tool support, because when reviewing code manually, an error in this class is very easily overseen.

I've not checked whether my patch actually helps with overflows. Instrumenting Wine with a GetTickCount
(and other counters) near overflow would be an interesting exercise.  Some people actually run
Wine long enough for that to happen!

Feedback is welcome.
 Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-winmm-Handle-GetTickCount-overflow-in-MIDI-player.patch
Type: application/octet-stream
Size: 1032 bytes
Desc: 0001-winmm-Handle-GetTickCount-overflow-in-MIDI-player.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130214/be47c23b/attachment.obj>


More information about the wine-patches mailing list