On Wed, Apr 01, 2015 at 03:25:23AM +0200, Lukasz Marek wrote: > Fixes following scenario: > > av_dict_set(&d, "key", "old", 0); > AVDictionaryEentry *e = av_dict_get(d, "key", NULL, 0); > av_dict_set(&d, e->key, "new", 0); > > Signed-off-by: Lukasz Marek <lukasz.m.lu...@gmail.com> > --- > libavutil/dict.c | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > > diff --git a/libavutil/dict.c b/libavutil/dict.c > index 0d54c79..3163894 100644 > --- a/libavutil/dict.c > +++ b/libavutil/dict.c > @@ -72,6 +72,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const > char *value, > AVDictionary *m = *pm; > AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags); > char *oldval = NULL; > + int the_same_key = 0; >
does it work to av_strdup() both key and value if they need to be strduped but at the top of the function and simplify the rest accordingly ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 3 "Rare item" - "Common item with rare defect or maybe just a lie" "Professional" - "'Toy' made in china, not functional except as doorstop" "Experts will know" - "The seller hopes you are not an expert"
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel