[FFmpeg-cvslog] dict.c: minor simplification.

Reimar Döffinger git at videolan.org
Thu Jul 31 20:11:15 CEST 2014


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Tue Jul 29 21:23:14 2014 +0200| [f0de01856fde4a104254569f9d5c80a80cac49cc] | committer: Reimar Döffinger

dict.c: minor simplification.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f0de01856fde4a104254569f9d5c80a80cac49cc
---

 libavutil/dict.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavutil/dict.c b/libavutil/dict.c
index 358958c..aea8910 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)
             return AVERROR(ENOMEM);
+        m->elems = tmp;
     }
     if (value) {
         if (flags & AV_DICT_DONT_STRDUP_KEY)



More information about the ffmpeg-cvslog mailing list