1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/vvc/dec: fix possible null-pointer dereference

When checking for filmgrain here, needs_fg can be true even when
film_grain_characteristics is NULL (when aom_film_grain.enable is true),
therefore this check could end up dereferencing film_grain_characteristics
even though it is NULL.

Fix CID 1648347
This commit is contained in:
Marvin Scholz
2025-06-11 19:53:29 +02:00
committed by Nuo Mi
parent 26807592e1
commit 3d7668dae1

View File

@ -770,7 +770,8 @@ static int check_film_grain(VVCContext *s, VVCFrameContext *fc)
!s->avctx->hwaccel; !s->avctx->hwaccel;
if (fc->ref->needs_fg && if (fc->ref->needs_fg &&
(fc->sei.common.film_grain_characteristics->present && (fc->sei.common.film_grain_characteristics &&
fc->sei.common.film_grain_characteristics->present &&
!ff_h274_film_grain_params_supported(fc->sei.common.film_grain_characteristics->model_id, !ff_h274_film_grain_params_supported(fc->sei.common.film_grain_characteristics->model_id,
fc->ref->frame->format) || fc->ref->frame->format) ||
!av_film_grain_params_select(fc->ref->frame))) { !av_film_grain_params_select(fc->ref->frame))) {