lavu/opt: check for NULL before parsing

set_string_binary crashes when called with val==NULL

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
pull/95/head
Lukasz Marek 10 years ago
parent 7edb5eec4f
commit bb60142f56
  1. 5
      libavutil/opt.c

@ -126,11 +126,14 @@ static int set_string_binary(void *obj, const AVOption *o, const char *val, uint
{
int *lendst = (int *)(dst + 1);
uint8_t *bin, *ptr;
int len = strlen(val);
int len;
av_freep(dst);
*lendst = 0;
if (!val || !(len = strlen(val)))
return 0;
if (len & 1)
return AVERROR(EINVAL);
len /= 2;

Loading…
Cancel
Save