summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2025-11-19 17:52:38 +0100
committerSteve Sakoman <steve@sakoman.com>2025-12-01 06:50:49 -0800
commitc76f44b1da3563b8acd364ea0c632265aa3f7e83 (patch)
tree37941bfc00e6dc1b3978eda0debf73dcfaa51248 /meta
parent088d1497d5e85e28309804b26378b13231ec99b1 (diff)
downloadpoky-c76f44b1da3563b8acd364ea0c632265aa3f7e83.tar.gz
flac: patch seeking bug
While working on audiofile recipe from meta-oe, a test that is using flac to convert a flac file failed with this particular version of the recipe. Bisecting the issue pointed to a code snippet that later was modifed with the patch that is introduced here: in version 1.3.4 there is a bug with seeking in flac files, returning incorrect pointers. This backported patch fixes this (and fixes the ptest also, that triggered this). (From OE-Core rev: ceef3cde9b761b7b5de6f7b6b1fb8e99663af9ca) Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-multimedia/flac/files/0001-Fix-seeking-bug.patch34
-rw-r--r--meta/recipes-multimedia/flac/flac_1.3.4.bb3
2 files changed, 36 insertions, 1 deletions
diff --git a/meta/recipes-multimedia/flac/files/0001-Fix-seeking-bug.patch b/meta/recipes-multimedia/flac/files/0001-Fix-seeking-bug.patch
new file mode 100644
index 0000000000..dadedcc168
--- /dev/null
+++ b/meta/recipes-multimedia/flac/files/0001-Fix-seeking-bug.patch
@@ -0,0 +1,34 @@
1From 1817916388cd8180f4411e6d0eb89a8c6916dce6 Mon Sep 17 00:00:00 2001
2From: Martijn van Beurden <mvanb1@gmail.com>
3Date: Mon, 25 Apr 2022 20:29:57 +0200
4Subject: [PATCH] Fix seeking bug
5
6Commit 159cd6c introduced a bug that only triggered upon seeking
7from the start of a headerless FLAC file to the first frame (so
8really not a seek at all). Furthermore that commit did nothing
9else in any other circumstance. This commit fixes that, by both
10fixing the problem and the behaviour the commit mentioned earlier
11meant to introduce.
12
13Co-authored-by: Robert Kausch <robert.kausch@freac.org>
14
15Upstream-Status: Backport [https://github.com/xiph/flac/commit/7e785eb9a84f9147246eb2b0e5e35ec01db5a815]
16Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
17---
18 src/libFLAC/stream_decoder.c | 3 ++-
19 1 file changed, 2 insertions(+), 1 deletion(-)
20
21diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
22index ef6da44..bc78645 100644
23--- a/src/libFLAC/stream_decoder.c
24+++ b/src/libFLAC/stream_decoder.c
25@@ -3077,7 +3077,8 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s
26 upper_bound = stream_length;
27 upper_bound_sample = total_samples > 0 ? total_samples : target_sample /*estimate it*/;
28
29- if(decoder->protected_->state == FLAC__STREAM_DECODER_READ_FRAME) {
30+ if(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC &&
31+ decoder->private_->samples_decoded != 0) {
32 if(target_sample < decoder->private_->samples_decoded) {
33 if(FLAC__stream_decoder_get_decode_position(decoder, &upper_bound))
34 upper_bound_sample = decoder->private_->samples_decoded;
diff --git a/meta/recipes-multimedia/flac/flac_1.3.4.bb b/meta/recipes-multimedia/flac/flac_1.3.4.bb
index 1a44718bba..6df0668783 100644
--- a/meta/recipes-multimedia/flac/flac_1.3.4.bb
+++ b/meta/recipes-multimedia/flac/flac_1.3.4.bb
@@ -16,7 +16,8 @@ DEPENDS = "libogg"
16 16
17SRC_URI = "http://downloads.xiph.org/releases/flac/${BP}.tar.xz \ 17SRC_URI = "http://downloads.xiph.org/releases/flac/${BP}.tar.xz \
18 file://CVE-2020-22219.patch \ 18 file://CVE-2020-22219.patch \
19" 19 file://0001-Fix-seeking-bug.patch \
20 "
20 21
21SRC_URI[sha256sum] = "8ff0607e75a322dd7cd6ec48f4f225471404ae2730d0ea945127b1355155e737" 22SRC_URI[sha256sum] = "8ff0607e75a322dd7cd6ec48f4f225471404ae2730d0ea945127b1355155e737"
22 23