diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-03-25 17:09:05 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-03-25 18:02:34 -0400 |
commit | ded716267196862809e5926072adc962a611a1e3 (patch) | |
tree | cb593f0a48af126cf67ba2b8ea40c12749ad296e /drivers/media/platform | |
parent | bf78f23acf023d5bc9d31bab2918a3092dc821f0 (diff) |
media: hfi_parser: don't trick gcc with a wrong expected size
Smatch warns about small size on two structs:
drivers/media/platform/qcom/venus/hfi_parser.c:103 parse_profile_level() error: memcpy() 'proflevel' too small (8 vs 128)
drivers/media/platform/qcom/venus/hfi_parser.c: drivers/media/platform/qcom/venus/hfi_parser.c:129 parse_caps() error: memcpy() 'cap' too small (16 vs 512)
The reason is that the hfi_parser actually expects:
- multiple data entries on hfi_capabilities
- multiple profile_level on hfi_profile_level_supported
However, the structs trick gcc, making it to believe that
there's just one value for each.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/qcom/venus/hfi_helper.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 15804ad7e65d..34ea503a9842 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -569,7 +569,7 @@ struct hfi_capability { struct hfi_capabilities { u32 num_capabilities; - struct hfi_capability data[1]; + struct hfi_capability *data; }; #define HFI_DEBUG_MSG_LOW 0x01 @@ -726,7 +726,7 @@ struct hfi_profile_level { struct hfi_profile_level_supported { u32 profile_count; - struct hfi_profile_level profile_level[1]; + struct hfi_profile_level *profile_level; }; struct hfi_quality_vs_speed { |