From befa1e91050929a6211a88c7a924372fc6bacd0c Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Sat, 27 Sep 2008 15:21:10 +0000 Subject: Avoid overlapped memcpy when MSG_ParseDeltaEntity is called from MVD code. --- source/q_msg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/q_msg.c') diff --git a/source/q_msg.c b/source/q_msg.c index 50e237e..96f8f76 100644 --- a/source/q_msg.c +++ b/source/q_msg.c @@ -1892,7 +1892,9 @@ void MSG_ParseDeltaEntity( const entity_state_t *from, // set everything to the state we are delta'ing from if( from ) { - memcpy( to, from, sizeof( *to ) ); + if( to != from ) { + memcpy( to, from, sizeof( *to ) ); + } VectorCopy( from->origin, to->old_origin ); } else { memset( to, 0, sizeof( *to ) ); -- cgit v1.2.3