intel / intel/media-driver

[Bug]: CODECHAL_ENC_HEVC_B_MB_ENC_CURBE_G9[0] [-Werror=array-bounds=]

Open
#1,770 2 comments 0 reactions 2 assignees Claimed by @bai-isaac View on GitHub
Encode HEVC
Dominant language
C
Stars
1.2k
Forks
383
Avg merge
8d 18h
Merged PRs (30d)
4

Description

### Which component impacted?

Build

### Is it regression? Good in old configuration?

No, this issue exist a long time

### What happened?

Building current media-driver with -Werror leads to the following build failure on fedora 40 x86_64:

struct CODECHAL_ENC_HEVC_B_MB_ENC_CURBE_G9[0]’ is partly outside array bounds of ‘uint32_t[56]’ [-Werror=array-bounds=]

```
/builddir/build/BUILD/media-driver-intel-media-23.4.3/media_driver/agnostic/gen9/codec/hal/codechal_encode_hevc_g9.cpp: In member function ‘CodechalEncHevcStateG9::SetupBrcConstantTable(MOS_SURFACE*)’:
/builddir/build/BUILD/media-driver-intel-media-23.4.3/media_driver/agnostic/gen9/codec/hal/codechal_encode_hevc_g9.cpp:6193:23: error: array subscript ‘struct CODECHAL_ENC_HEVC_B_MB_ENC_CURBE_G9[0]’ is partly outside array bounds of ‘uint32_t[56]’ [-Werror=array-bounds=]
6193 | if(curbe->DW3.BlockBasedSkipEnable)
| ^~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/media-driver-intel-media-23.4.3/media_driver/agnostic/gen9/codec/hal/codechal_encode_hevc_g9.cpp:2950:16: note: object ‘CodechalEncHevcStateG9::m_encBTu7PCurbeInit’ of size 224
2950 | const uint32_t CodechalEncHevcStateG9::m_encBTu7PCurbeInit[56] =
| ^~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/media-driver-intel-media-23.4.3/media_driver/agnostic/gen9/codec/hal/codechal_encode_hevc_g9.cpp:2893:16: note: object ‘CodechalEncHevcStateG9::m_encBTu1BCurbeInit’ of size 224
2893 | const uint32_t CodechalEncHevcStateG9::m_encBTu1BCurbeInit[56] =
| ^~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/media-driver-intel-media-23.4.3/media_driver/agnostic/gen9/codec/hal/codechal_encode_hevc_g9.cpp:2938:16: note: object ‘CodechalEncHevcStateG9::m_encBTu4PCurbeInit’ of size 224
2938 | const uint32_t CodechalEncHevcStateG9::m_encBTu4PCurbeInit[56] =
| ^~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/media-driver-intel-media-23.4.3/media_driver/agnostic/gen9/codec/hal/codechal_encode_hevc_g9.cpp:2926:16: note: object ‘CodechalEncHevcStateG9::m_encBTu1PCurbeInit’ of size 224
2926 | const uint32_t CodechalEncHevcStateG9::m_encBTu1PCurbeInit[56] =
| ^~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/media-driver-intel-media-23.4.3/media_driver/agnostic/gen9/codec/hal/codechal_encode_hevc_g9.cpp:2904:16: note: object ‘CodechalEncHevcStateG9::m_encBTu4BCurbeInit’ of size 224
2904 | const uint32_t CodechalEncHevcStateG9::m_encBTu4BCurbeInit[56] =
| ^~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/media-driver-intel-media-23.4.3/media_driver/agnostic/gen9/codec/hal/codechal_encode_hevc_g9.cpp:2915:16: note: object ‘CodechalEncHevcStateG9::m_encBTu7BCurbeInit’ of size 224
2915 | const uint32_t CodechalEncHevcStateG9::m_encBTu7BCurbeInit[56] =
| ^~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
```

### What's the usage scenario when you are seeing the problem?

Others

### What impacted?

_No response_

### Debug Information

_No response_

### Do you want to contribute a patch to fix the issue?

No.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.