From f7958d0883286479a6c9cd91e68e506dfa02ed7c Mon Sep 17 00:00:00 2001 From: James Almer Date: Sun, 25 Jul 2021 23:09:00 -0300 Subject: [PATCH] avcodec/h264_sei: honor the Film Grain Characteristics cancel flag Film Grain persistence is cancelled when it's true. Signed-off-by: James Almer --- libavcodec/h264_sei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c index b1785c6198..7797f24650 100644 --- a/libavcodec/h264_sei.c +++ b/libavcodec/h264_sei.c @@ -420,9 +420,9 @@ static int decode_alternative_transfer(H264SEIAlternativeTransfer *h, static int decode_film_grain_characteristics(H264SEIFilmGrainCharacteristics *h, GetBitContext *gb) { - int film_grain_characteristics_cancel_flag = get_bits1(gb); + h->present = !get_bits1(gb); // film_grain_characteristics_cancel_flag - if (!film_grain_characteristics_cancel_flag) { + if (h->present) { memset(h, 0, sizeof(*h)); h->model_id = get_bits(gb, 8); h->separate_colour_description_present_flag = get_bits1(gb);