opt: check memory allocation

CC: libav-stable@libav.org
Bug-Id: CID 1257771
(cherry picked from commit 07a0c0f000)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
Vittorio Giovara 2014-12-18 20:26:57 +01:00 committed by Luca Barbato
parent 932caa50a5
commit 61335ab33e

View File

@ -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++);