https://github.com/strukturag/libde265/commit/3e822a3ccf88df1380b165d6ce5a00494a27ceeb Straight from upstream To be removed with libde265-1.0.15 or later From 3e822a3ccf88df1380b165d6ce5a00494a27ceeb Mon Sep 17 00:00:00 2001 From: Dirk Farin Date: Thu, 23 Nov 2023 19:11:34 +0100 Subject: [PATCH] fix #432 (undefined IPM) --- libde265/image.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libde265/image.h b/libde265/image.h index 0b536054..0a0c0e32 100644 --- a/libde265/image.h +++ b/libde265/image.h @@ -624,7 +624,14 @@ struct de265_image { enum IntraPredMode get_IntraPredMode(int x,int y) const { - return (enum IntraPredMode)intraPredMode.get(x,y); + uint8_t ipm = intraPredMode.get(x,y); + + // sanitize values if IPM is uninitialized (because of earlier read error) + if (ipm > 34) { + ipm = 0; + } + + return static_cast(ipm); } enum IntraPredMode get_IntraPredMode_atIndex(int idx) const