diff --git a/modules/packetizer/h26x_nal_common.h b/modules/packetizer/h26x_nal_common.h index fabe174507..a44cd4c549 100644 --- a/modules/packetizer/h26x_nal_common.h +++ b/modules/packetizer/h26x_nal_common.h @@ -20,6 +20,7 @@ #ifndef H26X_NAL_COMMON_H # define H26X_NAL_COMMON_H +#include #include #include "iso_color_tables.h" @@ -55,6 +56,12 @@ bool h26x_get_picture_size( nal_u2_t chroma_format_idc, w = vw = pic_width_in_luma_samples; h = vh = pic_height_in_luma_samples; + if( chroma_format_idc > 3 ) + { + assert( chroma_format_idc <= 3 ); + return false; + } + static const uint8_t SubWidthHeight[4][2] = { {1, 1}, {2, 2}, {2, 1}, {1, 1} }; ox = conf_win->left_offset * SubWidthHeight[chroma_format_idc][0];