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
Unified · Split
| @@ -770,7 +770,8 @@ static int check_film_grain(VVCContext *s, VVCFrameContext *fc) · 769 unmodified lines | ||
| 770 | 770 | !s->avctx->hwaccel; |
| 771 | 771 | |
| 772 | 772 | if (fc->ref->needs_fg && |
| 773 | − (fc->sei.common.film_grain_characteristics->present && | |
| 773 | + (fc->sei.common.film_grain_characteristics && | |
| 774 | + fc->sei.common.film_grain_characteristics->present && | |
| 774 | 775 | !ff_h274_film_grain_params_supported(fc->sei.common.film_grain_characteristics->model_id, |
| 775 | 776 | fc->ref->frame->format) || |
| 776 | 777 | !av_film_grain_params_select(fc->ref->frame))) { |