You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avutil/dict: Avoid check whose result is known in advance
We know that an AVDictionary is not empty if we have just added an entry to it, so only check for it being empty on the branch that does not do so. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -126,12 +126,12 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
|
||||
}
|
||||
m->count++;
|
||||
} else {
|
||||
if (!m->count) {
|
||||
av_freep(&m->elems);
|
||||
av_freep(pm);
|
||||
}
|
||||
av_freep(©_key);
|
||||
}
|
||||
if (!m->count) {
|
||||
av_freep(&m->elems);
|
||||
av_freep(pm);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
Reference in New Issue
Block a user