From c2e11fe4588bc33b99a60b78c87871af34a1fa70 Mon Sep 17 00:00:00 2001 From: Daniel Stankewitz Date: Thu, 8 Sep 2022 17:28:37 +0200 Subject: [PATCH] Create A01-metadata-copy-segfault-fix.patch --- .../A01-metadata-copy-segfault-fix.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/actions/libsvtav1/patches/A01-metadata-copy-segfault-fix.patch diff --git a/.github/actions/libsvtav1/patches/A01-metadata-copy-segfault-fix.patch b/.github/actions/libsvtav1/patches/A01-metadata-copy-segfault-fix.patch new file mode 100644 index 0000000..3111dcc --- /dev/null +++ b/.github/actions/libsvtav1/patches/A01-metadata-copy-segfault-fix.patch @@ -0,0 +1,37 @@ +From 213854249dc8d69653a9f3281cdd4c2063cd3779 Mon Sep 17 00:00:00 2001 +From: Christopher Degawa +Date: Wed, 10 Aug 2022 13:53:17 -0500 +Subject: [PATCH] copy_input_buffer: only copy metadata if a frame was actaully + sent + +Fixes a segfault if EOS was send through the library without zeroing +out the metadata array + +Signed-off-by: Christopher Degawa +--- + Source/Lib/Encoder/Globals/EbEncHandle.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/Source/Lib/Encoder/Globals/EbEncHandle.c b/Source/Lib/Encoder/Globals/EbEncHandle.c +index ba5e719a4..fc7a2b1f4 100644 +--- a/Source/Lib/Encoder/Globals/EbEncHandle.c ++++ b/Source/Lib/Encoder/Globals/EbEncHandle.c +@@ -4814,11 +4814,12 @@ static void copy_input_buffer(SequenceControlSet* scs, EbBufferHeaderType* dst, + } else if (pass != ENCODE_FIRST_PASS || copy_frame) { + // Bypass copy for the unecessary picture in IPPP pass + // Copy the picture buffer +- if (src->p_buffer != NULL) ++ if (src->p_buffer != NULL) { + copy_frame_buffer(scs, dst->p_buffer, dst_y8b->p_buffer, src->p_buffer, pass); +- // Copy the metadata array +- if (svt_aom_copy_metadata_buffer(dst, src->metadata) != EB_ErrorNone) +- dst->metadata = NULL; ++ // Copy the metadata array ++ if (svt_aom_copy_metadata_buffer(dst, src->metadata) != EB_ErrorNone) ++ dst->metadata = NULL; ++ } + } + + // Copy the private data list +-- +GitLab