From 99f4ca63776c8ca63387629cb2e66dfd778b63e7 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 9 Oct 2019 13:02:57 +0200 Subject: [PATCH] Lavd: fixed a NULL-pointer dereference --- src/video_decompress/libavcodec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video_decompress/libavcodec.c b/src/video_decompress/libavcodec.c index fc55bdf6f..90b947f2f 100644 --- a/src/video_decompress/libavcodec.c +++ b/src/video_decompress/libavcodec.c @@ -695,7 +695,10 @@ static int libavcodec_decompress_get_property(void *state, int property, void *v if (*len < sizeof(int)) { return FALSE; } - *(int *) val = strcmp(s->codec_ctx->codec->name, "h264") == 0; + *(int *) val = FALSE; + if (s->codec_ctx && strcmp(s->codec_ctx->codec->name, "h264") == 0) { + *(int *) val = TRUE; + } if (get_commandline_param("lavd-accept-corrupted")) { *(int *) val = strcmp(get_commandline_param("lavd-accept-corrupted"), "no") != 0;