[FFmpeg-devel] [PATCH, v2] lavc/qsvenc: Fix the memory leak for enc_ctrl.Payload

Li, Zhong zhong.li at intel.com
Wed May 22 17:21:13 EEST 2019


> From: Fu, Linjie
> Sent: Wednesday, May 22, 2019 1:50 PM
> To: Li, Zhong <zhong.li at intel.com>; FFmpeg development discussions and
> patches <ffmpeg-devel at ffmpeg.org>
> Subject: RE: [FFmpeg-devel] [PATCH, v2] lavc/qsvenc: Fix the memory leak
> for enc_ctrl.Payload
> 
> > -----Original Message-----
> > From: Li, Zhong
> > Sent: Monday, April 29, 2019 17:00
> > To: FFmpeg development discussions and patches <ffmpeg-
> > devel at ffmpeg.org>
> > Cc: Fu, Linjie <linjie.fu at intel.com>
> > Subject: RE: [FFmpeg-devel] [PATCH, v2] lavc/qsvenc: Fix the memory
> > leak for enc_ctrl.Payload
> >
> > > From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On
> > Behalf
> > > Of Linjie Fu
> > > Sent: Monday, April 15, 2019 9:23 PM
> > > To: ffmpeg-devel at ffmpeg.org
> > > Cc: Fu, Linjie <linjie.fu at intel.com>
> > > Subject: [FFmpeg-devel] [PATCH, v2] lavc/qsvenc: Fix the memory leak
> > > for enc_ctrl.Payload
> > >
> > > frame->enc_ctrl.Payload is malloced in get_free_frame, directly
> > > frame->memset
> > > the whole structure of enc_ctrl to zero will cause the memory leak
> > > for enc_ctrl.Payload.
> > >
> > > frame->enc_ctrl as a structure will be malloc and init to zero by
> > > frame->calling
> > > frame = av_mallocz(sizeof(*frame)), so the memset is redundant and
> > > can
> > be
> > > removed.
> > >
> > > Can be reproduced by #7830.
> >
> > Patch LGTM now, but I can't see strong relationship between this patch
> > and tikect #7830.
> > IMHO this is a quite common issue even if you use qsv transcoding
> pipeline?
> 
> Yes, it's not strongly related with the issue. Remove this would be fine.
> Thanks.

Applied with commit message modified. 
Thanks.


More information about the ffmpeg-devel mailing list