Re: Fix for memory corruption in yuvdeinterlace

"Stefan M. Fendt" <[email protected]> Wed, 10 Oct 2007 07:22:49 +0200
Newsgroups gmane.comp.video.mjpeg.devel
Message-ID <1191993769.1166.18.camel@lionfish>
Hi,

Ok, here what *should* be done inside yuvdeinterlace:

For speed reasons the functions are all allowed to overshot, that is: to
slightly violate the buffer-borders. The functions itself need a pointer
to the start of the image, and not(!) to the start of the buffer...

     [A0]     [A1]
     |        |
#####AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA################
..............FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.........................
     |        |                               |        |
     |        |                               |        |
  luma overshot       active-image-area       luma overshot

A ... allocated memory
F ... active pixels

So, the malloc *must* deliver address A0 and buffer[0] *must* point to
A1. The free() however, must be directed to A0 again...

cu
Stefan


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/