On Fri, Sep 27, 2013 at 11:30 AM, Jean-Baptiste Kempf <[email protected]>wrote:
> On 27 Sep, [email protected] wrote : > > - X265_FREE(fpelPlane); > > + X265_FREE(fpelPlane - m_startPad); > > Is this always allowed? > It's not robust, this if statement also needs to verify refPlane is not NULL applyWeight() also needs to check for earlier malloc failure and early-out. Also this line is unsafe: fpelPlane = (pixel*)X265_MALLOC(pixel, padwidth * padheight) + m_startPad; It needs to be two steps: fpelPlane = (pixel*)X265_MALLOC(pixel, padwidth * padheight); if (fpelPlan) fpelPlane += m_startPad; -- Steve Borho
_______________________________________________ x265-devel mailing list [email protected] https://mailman.videolan.org/listinfo/x265-devel
