Re: yuvdeinterlace crash

"Stefan M. Fendt" <[email protected]>
Newsgroups gmane.comp.video.mjpeg.devel
Message-ID <[email protected]>
Steven M. Schultz schrieb:
> Hi -
>
> 	Stefan - I think it's "back to the drawing board" :)
>   

Well, I noticed this one yesterday, too.

> 	The crash is because a memcpy is being done with the destination being
> 	BEFORE the start of the allocated buffer.
>   

Yes, for speed reasons all functions are allowed to overshot.

> 	Memory is allocated like this:
>
> 	inframe[0] = (uint8_t *) malloc (luma_size + vertical_overshot_luma);A
>   

This malloc is not OK. I can't recall who fixed that one but that fix 
was the bug ;-)

inframe[0] *must* point to a place inside the malloced memory. They way 
the malloc has been changed to is buggy. Luma_size is alreaddy bigger 
then required. inframe[0] must be shifted by vertical_overshot *after* 
the malloc, not inside it...

cu
Stefan


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.