[Ffmpeg-cvslog] r5996 - trunk/libavutil/mem.c

Hervé W. H.O.W.aka.V+ffmpeg
Tue Aug 15 21:12:13 CEST 2006


Hi,

On 15/08/06, Reimar D?ffinger wrote:
> Hello,
> On Sun, Aug 13, 2006 at 11:09:00PM +0200, michael wrote:
[...]
> >      ptr2= av_malloc(size);
> >      if(ptr && ptr2)
> >          memcpy(ptr2, ptr, size);
>
> This would have to be the minimum of the size for ptr and ptr2,
> unfortunately we don't know that for ptr.

I wondered about that, but I figured Michael would know what could be allowed.

> No idea what would be a good way to fix it...

Perhaps we could think of some options ?
- save the allocated size as well as 'diff' in the MEMALIGN_HACK code path
- always realloc() first, not just when MEMALIGN_HACK is NOT defined

Are there any other options?

-V




More information about the ffmpeg-cvslog mailing list