Nicolas George:
> Andreas Rheinhardt (12021-08-31):
>> You seem to misunderstand the semantics of the AV_DICT_DONT_STRDUP_*
>> flags: av_dict_set() takes complete ownership of the strings, even on
>> errors. So in case of errors the above code would lead to a double-free.
>> Patches #1 and #4 of this set are also affected by this.
> 
> Thanks, I made the same mistake last time. It is counter-intuitive:
> realloc() does not free its argument if it fails, for example. Anyway,
> fixed by moving the =NULL earlier.
> 
realloc is not supposed to transfer ownership, av_dict_set() with these
flags is. For me its behaviour makes sense (and avoids lots of av_free()
on failure paths).

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to