From d60651117963503d287fe15ad4df7cbad8ce4307 Mon Sep 17 00:00:00 2001 From: Consti10 Date: Tue, 30 Apr 2024 02:59:27 +0200 Subject: [PATCH] weird nalu bug --- .../linux/apps/hello_pi/hello_video/nalu/parse_x20_util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/host_applications/linux/apps/hello_pi/hello_video/nalu/parse_x20_util.h b/host_applications/linux/apps/hello_pi/hello_video/nalu/parse_x20_util.h index 2ce32e92b..02b642ee5 100644 --- a/host_applications/linux/apps/hello_pi/hello_video/nalu/parse_x20_util.h +++ b/host_applications/linux/apps/hello_pi/hello_video/nalu/parse_x20_util.h @@ -33,7 +33,8 @@ static uint8_t X20_PPS[]={ bool has_x20_sps= false; bool has_x20_pps= false; static int check_for_x20(const uint8_t* data, int data_len){ - if(data_len<3)return -1; + if(data_len<4)return -1; + if(!NALU::has_valid_prefix(data))return -1; NALU tmp(data,data_len); const auto type=tmp.get_nal_unit_type(); printf("Type:%s\n",tmp.get_nal_unit_type_as_string().c_str());