mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Protect DotCode from dimensions smaller than 5
This commit is contained in:
parent
411f083f57
commit
4c1c180fbf
@ -1282,7 +1282,12 @@ int dotcode(struct zint_symbol *symbol, const unsigned char source[], int length
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((height > 200) || (width > 200)) {
|
if ((height > 200) || (width > 200)) {
|
||||||
strcpy(symbol->errtxt, "526: Specified symbol size is too large (E20)");
|
strcpy(symbol->errtxt, "526: Specified symbol size is too large");
|
||||||
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((height < 5) || (width < 5)) {
|
||||||
|
strcpy(symbol->errtxt, "527: Specified symbol size has a dimension which is too small");
|
||||||
return ZINT_ERROR_INVALID_OPTION;
|
return ZINT_ERROR_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user