diff --git a/src/dec/vp8l.c b/src/dec/vp8l.c index 34ebd8c0..d347bf1c 100644 --- a/src/dec/vp8l.c +++ b/src/dec/vp8l.c @@ -139,7 +139,8 @@ static WEBP_INLINE int PlaneCodeToDistance(int xsize, int plane_code) { const int dist_code = code_to_plane_lut[plane_code - 1]; const int yoffset = dist_code >> 4; const int xoffset = 8 - (dist_code & 0xf); - return yoffset * xsize + xoffset; + int dist = yoffset * xsize + xoffset; + return (dist >= 1) ? dist : 1; } }