From 2bf09a9d25dc9b29e8f96e36c71c8256645ec994 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Mon, 27 Oct 2014 20:03:33 +0100 Subject: [PATCH] avifil32: Simplify comparing two unsigned ints (PVS-Studio). --- dlls/avifil32/editstream.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/avifil32/editstream.c b/dlls/avifil32/editstream.c index 6d387250e3e..3aa8637ae1a 100644 --- a/dlls/avifil32/editstream.c +++ b/dlls/avifil32/editstream.c @@ -169,10 +169,9 @@ static HRESULT AVIFILE_RemoveStream(IAVIEditStreamImpl* const This, DWORD nr) /* remove part nr */ IAVIStream_Release(This->pStreams[nr].pStream); This->nStreams--; - if (This->nStreams - nr > 0) { - memmove(This->pStreams + nr, This->pStreams + nr + 1, - (This->nStreams - nr) * sizeof(EditStreamTable)); - } + if (nr < This->nStreams) + memmove(&This->pStreams[nr], &This->pStreams[nr + 1], + (This->nStreams - nr) * sizeof(This->pStreams[0])); This->pStreams[This->nStreams].pStream = NULL; This->pStreams[This->nStreams].dwStart = 0; This->pStreams[This->nStreams].dwLength = 0;