libsndfile1: patch CVE-2025-56226
PATCH 1/1 libsndfile1: patch CVE-2025-56226
From: Peter Marko <[email protected]>
Pick patches from both PRs linked in issue mentioned in NVD report.
Signed-off-by Peter Marko <[email protected]>
--- .../libsndfile1/CVE-2025-56226-01.patch | 36 ++++++++++++++++ .../libsndfile1/CVE-2025-56226-02.patch | 43 +++++++++++++++++++ .../libsndfile/libsndfile1_1.2.2.bb | 2 + 3 files changed, 81 insertions(+) create mode 100644 meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2025-56226-01.patch create mode 100644 meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2025-56226-02.patch
meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2025-56226-01.patch new file +36 -0
@@ -0,0 +1,36 @@ +From d9a35ea0d5c64c19dd635ae578e0028df8f66d6a Mon Sep 17 00:00:00 2001 +From: Sisyphus-wang <[email protected]> +Date: Fri, 11 Jul 2025 15:14:48 +0800 +Subject: [PATCH] Update mpeg_l3_encode.c + +fix memoryLeak bug + +CVE: CVE-2025-56226 +Upstream-Status: Backport [https://github.com/libsndfile/libsndfile/commit/d9a35ea0d5c64c19dd635ae578e0028df8f66d6a] +Signed-off-by: Peter Marko <[email protected]> +--- + src/mpeg_l3_encode.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/mpeg_l3_encode.c b/src/mpeg_l3_encode.c +index 97324f79..04b1d501 100644 +--- a/src/mpeg_l3_encode.c ++++ b/src/mpeg_l3_encode.c +@@ -87,7 +87,8 @@ mpeg_l3_encoder_init (SF_PRIVATE *psf, int info_tag) + if (! (pmpeg->lamef = lame_init ())) + return SFE_MALLOC_FAILED ; + +- pmpeg->compression = -1.0 ; /* Unset */ ++ psf->codec_close = mpeg_l3_encoder_close ; /* Set psf->codec_close early*/ ++ pmpeg->compression = -1.0 ; /* Unset */ + + lame_set_in_samplerate (pmpeg->lamef, psf->sf.samplerate) ; + lame_set_num_channels (pmpeg->lamef, psf->sf.channels) ; +@@ -115,7 +116,6 @@ mpeg_l3_encoder_init (SF_PRIVATE *psf, int info_tag) + } + + psf->sf.seekable = 0 ; +- psf->codec_close = mpeg_l3_encoder_close ; + psf->byterate = mpeg_l3_encoder_byterate ; + psf->datalength = 0 ; +
meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2025-56226-02.patch new file +43 -0
43 lines not on this page · raw message
meta/recipes-multimedia/libsndfile/libsndfile1_1.2.2.bb +2 -0
@@ -11,6 +11,8 @@ SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/libsndfile-${PV}.tar.xz \ file://noopus.patch \ file://cve-2022-33065.patch \ file://CVE-2024-50612.patch \ + file://CVE-2025-56226-01.patch \ + file://CVE-2025-56226-02.patch \ " GITHUB_BASE_URI = "https://github.com/libsndfile/libsndfile/releases/"