aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-12-18 20:26:57 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-01-05 14:58:20 +0100
commit07a0c0f0005072d115ace61e60f46be68582cc3a (patch)
tree964be212783bf5a8bc79553ed1fda639b16ce2ad /libavutil
parent46808fdf04ab113df374157b90b506eb3110daf2 (diff)
downloadffmpeg-07a0c0f0005072d115ace61e60f46be68582cc3a.tar.gz
opt: check memory allocation
CC: libav-stable@libav.org Bug-Id: CID 1257771
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/opt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 6785a08741..b3435e0f0e 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -119,6 +119,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++);