[FFmpeg-cvslog] opt: check memory allocation

Vittorio Giovara git at videolan.org
Tue Jan 6 21:44:21 CET 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Thu Dec 18 20:26:57 2014 +0100| [07a0c0f0005072d115ace61e60f46be68582cc3a] | committer: Vittorio Giovara

opt: check memory allocation

CC: libav-stable at libav.org
Bug-Id: CID 1257771

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=07a0c0f0005072d115ace61e60f46be68582cc3a
---

 libavutil/opt.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 6785a08..b3435e0 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++);



More information about the ffmpeg-cvslog mailing list