Skip to content

Commit

Permalink
fix #432 (undefined IPM)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Nov 23, 2023
1 parent 03988ce commit 3e822a3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libde265/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<enum IntraPredMode>(ipm);
}

enum IntraPredMode get_IntraPredMode_atIndex(int idx) const
Expand Down

0 comments on commit 3e822a3

Please sign in to comment.