1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
commit 3e822a3ccf88df1380b165d6ce5a00494a27ceeb
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Thu Nov 23 19:11:34 2023 +0100
fix #432 (undefined IPM)
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 @@ public:
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<enum IntraPredMode>(ipm);
}
enum IntraPredMode get_IntraPredMode_atIndex(int idx) const
|