You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user