[FFmpeg-devel] [PATCH] avutil/dict: Print warning in case av_dict_set() fails to allocate memory

Michael Niedermayer michaelni at gmx.at
Sun Jun 28 17:37:03 CEST 2015


This avoids the need to print such warning in all callers

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavutil/dict.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/dict.c b/libavutil/dict.c
index 6ff1af5..3625f19 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -131,6 +131,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
     return 0;
 
 err_out:
+    av_log(NULL, AV_LOG_WARNING, "Failed to allocate memory in av_dict_set for element with key:'%s'\n", key);
     if (m && !m->count) {
         av_freep(&m->elems);
         av_freep(pm);
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list