[Bug 37124] New: PVS-Studio Error: Difference of unsigned numbers
https://bugs.winehq.org/show_bug.cgi?id=37124 Bug ID: 37124 Summary: PVS-Studio Error: Difference of unsigned numbers Product: Wine Version: 1.7.22 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: lukebenes(a)hotmail.com PVS-Studio identifies a Difference of unsigned numbers. V555 The expression 'This->nStreams - nr > 0' will work as 'This->nStreams != nr'. editstream.c 172 static HRESULT AVIFILE_RemoveStream(IAVIEditStreamImpl* const This, DWORD nr) { ... This->nStreams--; if (This->nStreams - nr > 0) { //<== memmove(This->pStreams + nr, This->pStreams + nr + 1, (This->nStreams - nr) * sizeof(EditStreamTable)); } ... } The nr variable has the unsigned type DWORD. Subtracting it will result in an unsigned value, too. If nr is larger than This->nStreams, then the condition will still be true. A similar issue: V555 The expression 'This->fInfo.dwStreams - nStream > 0' will work as 'This->fInfo.dwStreams != nStream'. avifile.c 469 details on the V555 error here: http://www.viva64.com/en/d/0146/ -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37124 Luke <lukebenes(a)hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- URL| |http://www.viva64.com/en/b/ | |0272/ -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37124 Michael Stefaniuc <mstefani(a)redhat.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |2bf09a9d25dc9b29e8f96e36c71 | |c8256645ec994 Status|UNCONFIRMED |RESOLVED CC| |mstefani(a)redhat.com Resolution|--- |FIXED --- Comment #1 from Michael Stefaniuc <mstefani(a)redhat.com> --- Fix commited. Thanks for the report. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37124 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #2 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 1.7.30. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org