1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

lavu/opt: handle NULL obj in av_opt_next

It indirectly also fixes av_opt_free for NULL objs.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
This commit is contained in:
Lukasz Marek
2014-11-23 00:48:17 +01:00
parent 2a89afb376
commit ea0d893817

View File

@@ -50,7 +50,10 @@ const AVOption *av_next_option(void *obj, const AVOption *last)
const AVOption *av_opt_next(void *obj, const AVOption *last) const AVOption *av_opt_next(void *obj, const AVOption *last)
{ {
AVClass *class = *(AVClass**)obj; const AVClass *class;
if (!obj)
return NULL;
class = *(const AVClass**)obj;
if (!last && class && class->option && class->option[0].name) if (!last && class && class->option && class->option[0].name)
return class->option; return class->option;
if (last && last[1].name) if (last && last[1].name)