Skip to content

Commit 3e822a3

Browse files
committed
fix #432 (undefined IPM)
1 parent 03988ce commit 3e822a3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

libde265/image.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,14 @@ struct de265_image {
624624

625625
enum IntraPredMode get_IntraPredMode(int x,int y) const
626626
{
627-
return (enum IntraPredMode)intraPredMode.get(x,y);
627+
uint8_t ipm = intraPredMode.get(x,y);
628+
629+
// sanitize values if IPM is uninitialized (because of earlier read error)
630+
if (ipm > 34) {
631+
ipm = 0;
632+
}
633+
634+
return static_cast<enum IntraPredMode>(ipm);
628635
}
629636

630637
enum IntraPredMode get_IntraPredMode_atIndex(int idx) const

0 commit comments

Comments
 (0)