From 15934d66c072fa2b2dc82ccb7bbc52d321da2bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alen=20Vre=C4=8Dko?= <332217+avrecko@users.noreply.github.com> Date: Sun, 24 May 2020 20:51:42 +0200 Subject: [PATCH] H265: Fixed inaccurate parsing of ref pic list modification (#773) Fixes #717: playback issue of HEVC content with cbcs encryption in AVplayer. --- AUTHORS | 1 + CONTRIBUTORS | 1 + packager/media/codecs/h265_parser.cc | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 4f1e15b48c..8c009d283d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,6 +13,7 @@ # # Please keep the list sorted. +Alen Vrecko Anders Hasselqvist Chun-da Chen Daniel CantarĂ­n diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b8d3e079c1..773f16c1d9 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -22,6 +22,7 @@ # # Please keep the list sorted. +Alen Vrecko Anders Hasselqvist Bei Li Chun-da Chen diff --git a/packager/media/codecs/h265_parser.cc b/packager/media/codecs/h265_parser.cc index d238572dab..a70ea03c43 100644 --- a/packager/media/codecs/h265_parser.cc +++ b/packager/media/codecs/h265_parser.cc @@ -877,7 +877,7 @@ H265Parser::Result H265Parser::SkipReferencePictureListModification( bool ref_pic_list_modification_flag_l0; TRUE_OR_RETURN(br->ReadBool(&ref_pic_list_modification_flag_l0)); if (ref_pic_list_modification_flag_l0) { - for (int i = 0; i <= pps.num_ref_idx_l0_default_active_minus1; i++) { + for (int i = 0; i <= slice_header.num_ref_idx_l0_active_minus1; i++) { TRUE_OR_RETURN(br->SkipBits(ceil(log2(num_pic_total_curr)))); } } @@ -886,7 +886,7 @@ H265Parser::Result H265Parser::SkipReferencePictureListModification( bool ref_pic_list_modification_flag_l1; TRUE_OR_RETURN(br->ReadBool(&ref_pic_list_modification_flag_l1)); if (ref_pic_list_modification_flag_l1) { - for (int i = 0; i <= pps.num_ref_idx_l1_default_active_minus1; i++) { + for (int i = 0; i <= slice_header.num_ref_idx_l1_active_minus1; i++) { TRUE_OR_RETURN(br->SkipBits(ceil(log2(num_pic_total_curr)))); } }