mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-08-07 15:19:39 +00:00
quic: Fix "UNINIT" caught by coverity
In case of the model evolution mode has a obsolete or non-valid value, just return, avoiding then the usage of non initalized variables.
This commit is contained in:
parent
2c5041c3f8
commit
7e4cfbe305
@ -911,9 +911,12 @@ static void find_model_params(Encoder *encoder,
|
||||
unsigned int bstart, bend = 0; /* bucket start and end, range : 0 to levels-1*/
|
||||
unsigned int repcntr; /* helper */
|
||||
|
||||
/* The only valid values are 1, 3 and 5.
|
||||
0, 2 and 4 are obsolete and the rest of the
|
||||
values are considered out of the range. */
|
||||
spice_static_assert (evol == 1 || evol == 3 || evol == 5);
|
||||
spice_assert(bpc <= 8 && bpc > 0);
|
||||
|
||||
|
||||
*ncounters = 8;
|
||||
|
||||
*levels = 0x1 << bpc;
|
||||
@ -939,14 +942,9 @@ static void find_model_params(Encoder *encoder,
|
||||
*repnext = 1;
|
||||
*mulsize = 4;
|
||||
break;
|
||||
case 0: /* obsolete */
|
||||
case 2: /* obsolete */
|
||||
case 4: /* obsolete */
|
||||
encoder->usr->error(encoder->usr, "findmodelparams(): evol value obsolete!!!\n");
|
||||
break;
|
||||
default:
|
||||
encoder->usr->error(encoder->usr, "findmodelparams(): evol out of range!!!\n");
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
*nbuckets = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user