[FFmpeg-devel] initializing re allocated memory in drawtext filter

Nicolas George george at nsup.org
Sun Feb 2 13:48:48 CET 2014


Le quartidi 14 pluviôse, an CCXXII, anshul a écrit :
> take the case of clip_interval(int wmax, int *x, int *w, int *dx)
> if memset is not done then x contain undefined value, if that
> undefined value is 0 or make greater the
> whole comparison greater then wmax
> 
> here is code for quick reference
> 289     if (dx)
> 290         *dx = 0;
> 291     if (*x < 0) {
> 292         if (dx)
> 293             *dx = -*x;
> 294         *w += *x;
> 295         *x = 0;
> 296     }
> 297     if (*x + *w > wmax)
> 298         *w = wmax - *x;
> over here x is used uninitialized

x is an argument of the function; if it is passer uninitialized, the culprit
is the caller, not clip_interval().
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140202/d772f061/attachment.asc>


More information about the ffmpeg-devel mailing list