mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
glx: lets compare drawing command sizes using MIN3
It has to fix coverity issue CID1470555:
```
481 if (bufSize > __GLX_RENDER_CMD_SIZE_LIMIT) {
482 bufSize = __GLX_RENDER_CMD_SIZE_LIMIT;
483 }
484 if (bufSize > __GLX_MAX_RENDER_CMD_SIZE) {
>>> CID 1470555: Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "bufSize = 64000;".
485 bufSize = __GLX_MAX_RENDER_CMD_SIZE;
486 }
```
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7965>
This commit is contained in:
parent
ef4101d6d7
commit
618e480f38
1 changed files with 3 additions and 8 deletions
|
|
@ -478,14 +478,9 @@ indirect_create_context_attribs(struct glx_screen *psc,
|
|||
** constrain by a software limit, then constrain by the protocl
|
||||
** limit.
|
||||
*/
|
||||
if (bufSize > __GLX_RENDER_CMD_SIZE_LIMIT) {
|
||||
bufSize = __GLX_RENDER_CMD_SIZE_LIMIT;
|
||||
}
|
||||
if (bufSize > __GLX_MAX_RENDER_CMD_SIZE) {
|
||||
bufSize = __GLX_MAX_RENDER_CMD_SIZE;
|
||||
}
|
||||
gc->maxSmallRenderCommandSize = bufSize;
|
||||
|
||||
gc->maxSmallRenderCommandSize = MIN3(bufSize, __GLX_RENDER_CMD_SIZE_LIMIT,
|
||||
__GLX_MAX_RENDER_CMD_SIZE);
|
||||
|
||||
|
||||
return gc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue