[FFmpeg-devel] [PATCH] Codec lookup: do not use codec_id
Benoit Fouet
benoit.fouet
Mon Aug 6 13:44:48 CEST 2007
Nicolas George wrote:
> Le nonidi 19 thermidor, an CCXV, Benoit Fouet a ?crit :
>
>> where is it freed ? what if several codecs are used in command line ?
>>
>
> It is never freed. In an earlier version of this patch, I tried freeing them
> in the places you are suggesting, but it crashed when there were several
> output files: the string was used after it was freed. Finding exactly where
> it can be freed is not obvious. Furthermore, adding the call to av_free
> where you suggest would only do half of the job, since the strings can be
> discarded on other places.
>
>
if you check and you free it before strduping it and at the end of
ffmpeg main program, that could do it, i think.
> I decided not to do it right now after remarking this fact: command line
> options of type OPT_STRING are av_strduped and not av_freed.
well, i don't think this is an excuse, you can find things in ffmpeg.c
which are strduped and freed too.
> If it is
> considered a real problem (but I believe the gain of memory would be smaller
> than the added code), it needs to be addressed separately.
>
>
i don't see why this should be addressed separately.
--
Ben
Purple Labs S.A.
www.purplelabs.com
More information about the ffmpeg-devel
mailing list