From: ankur.tyagi85@gmail.com
To: openembedded-devel@lists.openembedded.org
Cc: Ankur Tyagi <ankur.tyagi85@gmail.com>
Subject: [oe][meta-multimedia][wrynose][PATCH 6/22] libde265: patch CVE-2026-49346
Date: Thu, 3 Sep 2026 21:49:37 +1200 [thread overview]
Message-ID: <20260903094954.3240723-6-ankur.tyagi85@gmail.com> (raw)
In-Reply-To: <20260903094954.3240723-1-ankur.tyagi85@gmail.com>
From: Ankur Tyagi <ankur.tyagi85@gmail.com>
Details:
https://nvd.nist.gov/vuln/detail/cve-2026-49346
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
.../libde265/libde265/CVE-2026-49346.patch | 102 ++++++++++++++++++
.../libde265/libde265_1.0.19.bb | 1 +
2 files changed, 103 insertions(+)
create mode 100644 meta-multimedia/recipes-multimedia/libde265/libde265/CVE-2026-49346.patch
diff --git a/meta-multimedia/recipes-multimedia/libde265/libde265/CVE-2026-49346.patch b/meta-multimedia/recipes-multimedia/libde265/libde265/CVE-2026-49346.patch
new file mode 100644
index 0000000000..288295b08a
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/libde265/libde265/CVE-2026-49346.patch
@@ -0,0 +1,102 @@
+From 1667c33f2778a04f08ba4f7d6c1c16508350a779 Mon Sep 17 00:00:00 2001
+From: Dirk Farin <dirk.farin@gmail.com>
+Date: Tue, 26 May 2026 00:59:08 +0200
+Subject: [PATCH] fix integer overflow in image plane allocation size
+ (GHSA-vv8h-932h-7r86)
+
+(cherry picked from commit 8a1b5cf212f78e1c77cb46eb5d56e492a9336eb8)
+
+CVE: CVE-2026-49346
+Upstream-Status: Backport [https://github.com/strukturag/libde265/commit/8a1b5cf212f78e1c77cb46eb5d56e492a9336eb8]
+
+Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
+---
+ libde265/image.cc | 46 +++++++++++++++++++++++++++-------------------
+ 1 file changed, 27 insertions(+), 19 deletions(-)
+
+diff --git a/libde265/image.cc b/libde265/image.cc
+index 0b6071ba..94f3c974 100644
+--- a/libde265/image.cc
++++ b/libde265/image.cc
+@@ -70,10 +70,11 @@ LIBDE265_API void* de265_alloc_image_plane(struct de265_image* img, int cIdx,
+ void* inputdata, int inputstride, void *userdata)
+ {
+ int alignment = STANDARD_ALIGNMENT;
+- int stride = (img->get_width(cIdx) + alignment-1) / alignment * alignment;
+- int height = img->get_height(cIdx);
++ uint32_t stride = (img->get_width(cIdx) + alignment-1) / alignment * alignment;
++ uint32_t height = img->get_height(cIdx);
+
+- uint8_t* p = static_cast<uint8_t*>(ALLOC_ALIGNED_16(stride * height + MEMORY_PADDING));
++ // size computed in size_t: stride*height can exceed UINT32_MAX for large planes
++ uint8_t* p = static_cast<uint8_t*>(ALLOC_ALIGNED_16(static_cast<size_t>(stride) * height + MEMORY_PADDING));
+
+ if (p==nullptr) { return nullptr; }
+
+@@ -82,12 +83,14 @@ LIBDE265_API void* de265_alloc_image_plane(struct de265_image* img, int cIdx,
+ // copy input data if provided
+
+ if (inputdata != nullptr) {
+- if (inputstride == stride) {
+- memcpy(p, inputdata, stride*height);
++ if (inputstride == static_cast<int>(stride)) {
++ memcpy(p, inputdata, static_cast<size_t>(stride) * height);
+ }
+ else {
+- for (int y=0;y<height;y++) {
+- memcpy(p+y*stride, static_cast<char*>(inputdata) + inputstride*y, inputstride);
++ for (uint32_t y=0;y<height;y++) {
++ memcpy(p + static_cast<size_t>(y) * stride,
++ static_cast<char*>(inputdata) + static_cast<size_t>(inputstride) * y,
++ inputstride);
+ }
+ }
+ }
+@@ -107,30 +110,35 @@ LIBDE265_API void de265_free_image_plane(struct de265_image* img, int cIdx)
+ static int de265_image_get_buffer(de265_decoder_context* ctx,
+ de265_image_spec* spec, de265_image* img, void* userdata)
+ {
+- const int rawChromaWidth = spec->width / img->SubWidthC;
+- const int rawChromaHeight = spec->height / img->SubHeightC;
++ const uint32_t rawChromaWidth = spec->width / img->SubWidthC;
++ const uint32_t rawChromaHeight = spec->height / img->SubHeightC;
+
+- int luma_stride = (spec->width + spec->alignment-1) / spec->alignment * spec->alignment;
+- int chroma_stride = (rawChromaWidth + spec->alignment-1) / spec->alignment * spec->alignment;
++ uint32_t luma_stride = (spec->width + spec->alignment-1) / spec->alignment * spec->alignment;
++ uint32_t chroma_stride = (rawChromaWidth + spec->alignment-1) / spec->alignment * spec->alignment;
+
+ assert(img->BitDepth_Y >= 8 && img->BitDepth_Y <= 16);
+ assert(img->BitDepth_C >= 8 && img->BitDepth_C <= 16);
+
+- int luma_bpl = luma_stride * ((img->BitDepth_Y+7)/8);
+- int chroma_bpl = chroma_stride * ((img->BitDepth_C+7)/8);
++ uint32_t luma_bpl = luma_stride * ((img->BitDepth_Y+7)/8);
++ uint32_t chroma_bpl = chroma_stride * ((img->BitDepth_C+7)/8);
+
+- int luma_height = spec->height;
+- int chroma_height = rawChromaHeight;
++ uint32_t luma_height = spec->height;
++ uint32_t chroma_height = rawChromaHeight;
+
+ bool alloc_failed = false;
+
+- uint8_t* p[3] = { 0,0,0 };
+- p[0] = static_cast<uint8_t*>(ALLOC_ALIGNED_16(luma_height * luma_bpl + MEMORY_PADDING));
++ // Compute the plane sizes in size_t. Each operand fits in uint32_t, but the
++ // height * bytes-per-line product can exceed UINT32_MAX for large frames, so
++ // the multiplication must be done in 64 bits. Computing it in 32 bits wraps
++ // the allocation size to a small value while fill_image() later writes the
++ // real (size_t) size -> heap buffer overflow (GHSA-vv8h-932h-7r86).
++ uint8_t* p[3] = { nullptr,nullptr,nullptr };
++ p[0] = static_cast<uint8_t*>(ALLOC_ALIGNED_16(static_cast<size_t>(luma_height) * luma_bpl + MEMORY_PADDING));
+ if (p[0]==nullptr) { alloc_failed=true; }
+
+ if (img->get_chroma_format() != de265_chroma_mono) {
+- p[1] = static_cast<uint8_t*>(ALLOC_ALIGNED_16(chroma_height * chroma_bpl + MEMORY_PADDING));
+- p[2] = static_cast<uint8_t*>(ALLOC_ALIGNED_16(chroma_height * chroma_bpl + MEMORY_PADDING));
++ p[1] = static_cast<uint8_t*>(ALLOC_ALIGNED_16(static_cast<size_t>(chroma_height) * chroma_bpl + MEMORY_PADDING));
++ p[2] = static_cast<uint8_t*>(ALLOC_ALIGNED_16(static_cast<size_t>(chroma_height) * chroma_bpl + MEMORY_PADDING));
+
+ if (p[1]==nullptr || p[2]==nullptr) { alloc_failed=true; }
+ }
diff --git a/meta-multimedia/recipes-multimedia/libde265/libde265_1.0.19.bb b/meta-multimedia/recipes-multimedia/libde265/libde265_1.0.19.bb
index bca5c9d776..07d108b915 100644
--- a/meta-multimedia/recipes-multimedia/libde265/libde265_1.0.19.bb
+++ b/meta-multimedia/recipes-multimedia/libde265/libde265_1.0.19.bb
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=695b556799abb2435c97a113cdca512f"
SRC_URI = "git://github.com/strukturag/libde265.git;branch=master;protocol=https;tag=v${PV} \
file://CVE-2026-49295.patch \
file://CVE-2026-49337.patch \
+ file://CVE-2026-49346.patch \
"
SRCREV = "824b4138ecd51611d7073f1b50d5d6f982609b06"
next prev parent reply other threads:[~2026-09-03 9:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 9:49 [oe][meta-oe][wrynose][PATCH 1/22] jq: ignore CVE-2025-49014 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-oe][wrynose][PATCH 2/22] lcms: patch CVE-2026-42798 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-multimedia][wrynose][PATCH 3/22] libde265: mark CVE-2026-45382 and CVE-2026-45383 patched ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-multimedia][wrynose][PATCH 4/22] libde265: patch CVE-2026-49295 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-multimedia][wrynose][PATCH 5/22] libde265: patch CVE-2026-49337 ankur.tyagi85
2026-09-03 9:49 ` ankur.tyagi85 [this message]
2026-09-03 9:49 ` [oe][meta-oe][wrynose][PATCH 7/22] libfido2, libfido2-initial: ignore CVE-2026-40947 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-multimedia][wrynose][PATCH 8/22] libheif: patch CVE-2026-32738 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-multimedia][wrynose][PATCH 9/22] libheif: patch CVE-2026-32739 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-multimedia][wrynose][PATCH 10/22] libheif: patch CVE-2026-32740 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-multimedia][wrynose][PATCH 11/22] libheif: patch CVE-2026-32741 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-multimedia][wrynose][PATCH 12/22] libheif: patch CVE-2026-41071 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-multimedia][wrynose][PATCH 13/22] libheif: patch CVE-2026-62289 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-multimedia][wrynose][PATCH 14/22] libheif: patch CVE-2026-62377 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-networking][wrynose][PATCH 15/22] libiec61850: mark CVE-2024-45969 patched ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-networking][wrynose][PATCH 16/22] libiec61850: patch CVE-2026-18582 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-networking][wrynose][PATCH 17/22] libiec61850: patch CVE-2026-18583 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-networking][wrynose][PATCH 18/22] libiec61850: patch CVE-2026-19108 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-networking][wrynose][PATCH 19/22] libiec61850: patch CVE-2026-19206 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-oe][wrynose][PATCH 20/22] libkcapi: patch CVE-2026-71226 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-oe][wrynose][PATCH 21/22] libkcapi: patch CVE-2026-71227 ankur.tyagi85
2026-09-03 9:49 ` [oe][meta-oe][wrynose][PATCH 22/22] libkcapi: patch CVE-2026-71225 ankur.tyagi85
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260903094954.3240723-6-ankur.tyagi85@gmail.com \
--to=ankur.tyagi85@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox