From 18b156b54fd0221e4d47b7731bd9a48e825abf2a Mon Sep 17 00:00:00 2001 From: Yunus Kurt Date: Fri, 20 Sep 2024 16:56:58 +0200 Subject: [PATCH] patch 10 Change-Id: Ibd3081ff3d6d0af965584dcdd07077b9ff54c104 --- lib/src/signed_video_h26x_auth.c | 5 ++--- lib/src/signed_video_h26x_common.c | 4 ++-- lib/src/signed_video_h26x_sign.c | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/src/signed_video_h26x_auth.c b/lib/src/signed_video_h26x_auth.c index 6c39fa2..cafbcc7 100644 --- a/lib/src/signed_video_h26x_auth.c +++ b/lib/src/signed_video_h26x_auth.c @@ -151,12 +151,11 @@ verify_gop_hash(signed_video_t *self) * If the linked hash has not yet been updated with this NALU's hash, it updates the * linked hash with the first NALU hash and marks it as used. */ -void +static void update_link_hash_for_auth(signed_video_t *self) { const size_t hash_size = self->verify_data->hash_size; - h26x_nalu_list_t *nalu_list = self->nalu_list; - h26x_nalu_list_item_t *item = nalu_list->first_item; + h26x_nalu_list_item_t *item = self->nalu_list->first_item; while (item) { if (item->used_in_gop_hash && item->nalu->is_first_nalu_in_gop) { if (!item->used_for_linked_hash) { diff --git a/lib/src/signed_video_h26x_common.c b/lib/src/signed_video_h26x_common.c index 67b7291..10b753f 100644 --- a/lib/src/signed_video_h26x_common.c +++ b/lib/src/signed_video_h26x_common.c @@ -876,8 +876,8 @@ check_and_copy_hash_to_hash_list(signed_video_t *self, const uint8_t *hash, size /* * Updates the |linked_hash| buffer with the |hash|. The buffer contains 2 slots for hashes. - * When a new NALU is encountered in the stream, the values in the buffer are shifted, and the - * new hash is stored in the second slot, with the previous hash moved to the first slot. + * The values in the buffer are shifted, with the new hash stored in the second slot and the + * previous hash moved to the first slot. */ svrc_t update_linked_hash(signed_video_t *self, uint8_t *hash, size_t hash_size) diff --git a/lib/src/signed_video_h26x_sign.c b/lib/src/signed_video_h26x_sign.c index 0594057..ae61e53 100644 --- a/lib/src/signed_video_h26x_sign.c +++ b/lib/src/signed_video_h26x_sign.c @@ -574,7 +574,6 @@ signed_video_add_nalu_part_for_signing_with_timestamp(signed_video_t *self, // adding it to the SEI NALU. Now it is time to start a new GOP, that is, hash and add this // first NALU of the GOP. SV_THROW(hash_and_add(self, &nalu)); - // Update link hash with |self->gop_info->nalu_hash|. SV_THROW(update_linked_hash(self, self->gop_info->nalu_hash, self->sign_data->hash_size)); } }