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

Paul B Mahol onemda at gmail.com
Sun Jun 28 17:46:23 CEST 2015


On 6/28/15, Michael Niedermayer <michaelni at gmx.at> wrote:
> 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

lgtm


More information about the ffmpeg-devel mailing list