[FFmpeg-devel] [PATCH 01/10] zlib decoder

Aurelien Jacobs aurel
Mon Jul 16 10:53:44 CEST 2007


On Mon, 16 Jul 2007 08:24:45 +0100
M?ns Rullg?rd <mans at mansr.com> wrote:

> Vadim Lebedev <vadim at mbdsys.com> writes:
> 
> >>>>+static void
> >>>>+copy_bytes(uint8_t *dst, uint8_t *src, unsigned int len)
> >>>>+{
> >>>>+    while (len--)
> >>>>+        *dst++ = *src++;
> >>>>+}
> >>>>      
> >>>i think we have such a copy routine somewhere already, but i dont remember
> >>>where
> >>
> >>Reimar said it looked familiar too.  Wherever it is, it's not in a
> >>central location.  Where would be the appropriate place for a function
> >>like this?
> >>
> > Why don't you simply use memcpy in this case?
> 
> Because memcpy() has undefined behaviour if the source and destination
> overlap.

Sure, but is there any reason why you can't use memmove() ?

Aurel




More information about the ffmpeg-devel mailing list