opt: check memory allocation

Bug-Id: CID 1257771
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Vittorio Giovara 2014-12-18 20:26:57 +01:00 committed by Michael Niedermayer
parent 7caee17204
commit 28fba55306

View File

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