diff --git a/libavutil/opt.c b/libavutil/opt.c index e9ed765781..7f8a0c4267 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -150,6 +150,8 @@ static int set_string_binary(void *obj, const AVOption *o, const char *val, uint len /= 2; ptr = bin = av_malloc(len); + if (!ptr) + return AVERROR(ENOMEM); while (*val) { int a = hexchar2int(*val++); int b = hexchar2int(*val++);