From 415d5af03ded20a0641d9bf8e8c0e9086d39c5f7 Mon Sep 17 00:00:00 2001 From: KUDr Date: Wed, 4 Jul 2007 02:41:39 +0000 Subject: [PATCH] (svn r10429) -Fix: VC8 Code Analyzer warning: buffer overrun --- src/rail.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rail.h b/src/rail.h index 52139b69a6..37944cb3d9 100644 --- a/src/rail.h +++ b/src/rail.h @@ -290,8 +290,8 @@ static inline Track FindFirstTrack(TrackBits tracks) */ static inline Track TrackBitsToTrack(TrackBits tracks) { - assert(tracks == INVALID_TRACK_BIT || (tracks != TRACK_BIT_NONE && KILL_FIRST_BIT(tracks) == 0)); - return tracks != INVALID_TRACK_BIT ? (Track)FIND_FIRST_BIT(tracks) : INVALID_TRACK; + assert(tracks == INVALID_TRACK_BIT || (tracks != TRACK_BIT_NONE && KILL_FIRST_BIT(tracks & TRACK_BIT_MASK) == 0)); + return tracks != INVALID_TRACK_BIT ? (Track)FIND_FIRST_BIT(tracks & TRACK_BIT_MASK) : INVALID_TRACK; } /**