[FFmpeg-devel] [PATCH 2/3] dict.c: minor simplification.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Jul 29 21:26:49 CEST 2014


Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavutil/dict.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavutil/dict.c b/libavutil/dict.c
index 66a0773..2cd67e8 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -90,10 +90,9 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
     } else {
         AVDictionaryEntry *tmp = av_realloc(m->elems,
                                             (m->count + 1) * sizeof(*m->elems));
-        if (tmp)
-            m->elems = tmp;
-        else
+        if (!tmp)
             goto err_out;
+        m->elems = tmp;
     }
     if (value) {
         if (flags & AV_DICT_DONT_STRDUP_KEY)
-- 
2.0.1



More information about the ffmpeg-devel mailing list