[FFmpeg-devel] [FFmpeg-cvslog] hevc: free sao buffers when receiving a new SPS

Michael Niedermayer michaelni at gmx.at
Thu Feb 5 22:38:01 CET 2015


On Thu, Feb 05, 2015 at 10:24:49PM +0100, Clément Bœsch wrote:
> On Thu, Feb 05, 2015 at 10:00:19PM +0100, Christophe Gisquet wrote:
> > ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Thu Feb  5 19:51:22 2015 +0100| [9a2f5d825a257cc72d569a91746219c7974da6e4] | committer: Michael Niedermayer
> > 
> > hevc: free sao buffers when receiving a new SPS
> > 
> > The buffer pointers would be otherwise overwritten, causing a
> > leak on e.g. PERSIST_RPARAM_A_RExt_Sony_1.
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > 
> > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a2f5d825a257cc72d569a91746219c7974da6e4
> > ---
> > 
> >  libavcodec/hevc.c |    9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
> > index 0624cb0..afbfda1 100644
> > --- a/libavcodec/hevc.c
> > +++ b/libavcodec/hevc.c
> > @@ -284,7 +284,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
> >  {
> >      #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL)
> >      enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
> > -    int ret;
> > +    int ret, i;
> >      unsigned int num = 0, den = 0;
> >  
> >      pic_arrays_free(s);
> > @@ -334,6 +334,13 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
> >      ff_hevc_dsp_init (&s->hevcdsp, sps->bit_depth);
> >      ff_videodsp_init (&s->vdsp,    sps->bit_depth);
> >  
> > +    for (i = 0; i < 3; i++) {
> 
> > +        if (s->sao_pixel_buffer_h[i])
> > +            av_freep(&s->sao_pixel_buffer_h[i]);
> > +        if (s->sao_pixel_buffer_v[i])
> > +            av_freep(&s->sao_pixel_buffer_v[i]);
> 
> Unecessary if, please drop them

fixed

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150205/9e92714a/attachment.asc>


More information about the ffmpeg-devel mailing list