diff options
author | Kenneth Graunke <[email protected]> | 2017-04-12 09:53:44 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-04-16 22:58:23 -0700 |
commit | 9b71709cb8532cda4bfbbcbf4d0d86d53c0dffb9 (patch) | |
tree | ce9f73d1b72786605717491f810bbb1c8bfe110d /src | |
parent | 6142c3e2983d8723c31d04f6a9762f0ec916e48b (diff) |
intel/decoder: Fix is_header_field starting condition.
Starting positions >= 32 are not part of the header, rather than >.
Caught by Coverity, which found that "bits <<= field->start" may shift
by 32, which has undefined behavior.
CID: 1404968
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/common/gen_decoder.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c index 03c9c7f8d46..e3327d38542 100644 --- a/src/intel/common/gen_decoder.c +++ b/src/intel/common/gen_decoder.c @@ -849,7 +849,7 @@ is_header_field(struct gen_group *group, struct gen_field *field) { uint32_t bits; - if (field->start > 32) + if (field->start >= 32) return false; bits = (1U << (field->end - field->start + 1)) - 1; |