avformat/mov: don't reallocate extradata when converting dvdsub palette

After introduction of ff_dvdclut_palette_extradata_cat() to convert
DVD subtitle palettes from YUV to RGB, a leak is introduced because
of the call to ff_alloc_extradata(). This is not necessary, instead
we should free the extradata because ff_bprint_to_codecpar_extradata()
will finalize the bprint'ed string to the codecpar and set the length.

Fixes leak introduced in 3b0e6c0ecc.

Signed-off-by: Marth64 <marth64@proxyid.net>
master
Marth64 2 weeks ago
parent b164dea68c
commit 8291aedf1a
  1. 5
      libavformat/mov.c

@ -10602,9 +10602,8 @@ static int mov_read_header(AVFormatContext *s)
if (err < 0) if (err < 0)
return err; return err;
err = ff_alloc_extradata(st->codecpar, FF_DVDCLUT_EXTRADATA_SIZE); av_freep(&st->codecpar->extradata);
if (err < 0) st->codecpar->extradata_size = 0;
return err;
err = ff_dvdclut_palette_extradata_cat(dvdsub_clut, FF_DVDCLUT_CLUT_SIZE, err = ff_dvdclut_palette_extradata_cat(dvdsub_clut, FF_DVDCLUT_CLUT_SIZE,
st->codecpar); st->codecpar);

Loading…
Cancel
Save