diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-12-18 20:26:57 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-01-12 22:19:38 +0100 |
commit | 61335ab33e594d47b84fde7367ee10dc66fc3465 (patch) | |
tree | 73058714e6f9e2c21e27f3790dbebcc1dabbd5d2 | |
parent | 932caa50a5dec7f2a69da8a417ccae84d19ae5e5 (diff) | |
download | ffmpeg-61335ab33e594d47b84fde7367ee10dc66fc3465.tar.gz |
opt: check memory allocation
CC: libav-stable@libav.org
Bug-Id: CID 1257771
(cherry picked from commit 07a0c0f0005072d115ace61e60f46be68582cc3a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | libavutil/opt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index 28adef6877..059c525c39 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++); |