diff --git a/include/nuttx/video/rfb.h b/include/nuttx/video/rfb.h index 577892d325..9eb6d63df5 100644 --- a/include/nuttx/video/rfb.h +++ b/include/nuttx/video/rfb.h @@ -356,7 +356,7 @@ struct rfb_setencodings_s }; #define SIZEOF_RFB_SETENCODINGS_S(n) \ - (sizeof(struct rfb_setencodings_s) + (((n) - 1) << 2)) + (sizeof(struct rfb_setencodings_s) + ((n) == 0 ? -4 : ((n) - 1) << 2)) /* 6.4.3 FramebufferUpdateRequest *