mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-24 07:05:40 -07:00
fix coverity CID 301400|301401
This commit is contained in:
parent
00b4636be1
commit
11362c66f1
1 changed files with 5 additions and 3 deletions
|
@ -92,8 +92,10 @@ static model_t models[] = {
|
||||||
static int CmdHelp(const char *Cmd);
|
static int CmdHelp(const char *Cmd);
|
||||||
|
|
||||||
static int picture_bit_depth(const uint8_t *bmp, const size_t bmpsize, const uint8_t model_nr) {
|
static int picture_bit_depth(const uint8_t *bmp, const size_t bmpsize, const uint8_t model_nr) {
|
||||||
if (bmpsize < sizeof(BMP_HEADER))
|
if (bmpsize < sizeof(BMP_HEADER)) {
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
|
}
|
||||||
|
|
||||||
BMP_HEADER *pbmpheader = (BMP_HEADER *)bmp;
|
BMP_HEADER *pbmpheader = (BMP_HEADER *)bmp;
|
||||||
PrintAndLogEx(DEBUG, "colorsused = %d", pbmpheader->colorsused);
|
PrintAndLogEx(DEBUG, "colorsused = %d", pbmpheader->colorsused);
|
||||||
PrintAndLogEx(DEBUG, "pbmpheader->bpp = %d", pbmpheader->bpp);
|
PrintAndLogEx(DEBUG, "pbmpheader->bpp = %d", pbmpheader->bpp);
|
||||||
|
@ -403,14 +405,14 @@ static int read_bmp_rgb(uint8_t *bmp, const size_t bmpsize, uint8_t model_nr, ui
|
||||||
|
|
||||||
if ((model_nr == M1in54B) || (model_nr == M2in13B)) {
|
if ((model_nr == M1in54B) || (model_nr == M2in13B)) {
|
||||||
// for BW+Red screens:
|
// for BW+Red screens:
|
||||||
uint8_t *mapBlack = calloc(width * height, sizeof(uint8_t));
|
uint8_t *mapBlack = calloc((uint32_t)(width * height), sizeof(uint8_t));
|
||||||
if (mapBlack == NULL) {
|
if (mapBlack == NULL) {
|
||||||
free(chanR);
|
free(chanR);
|
||||||
free(chanG);
|
free(chanG);
|
||||||
free(chanB);
|
free(chanB);
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
uint8_t *mapRed = calloc(width * height, sizeof(uint8_t));
|
uint8_t *mapRed = calloc((uint32_t)(width * height), sizeof(uint8_t));
|
||||||
if (mapRed == NULL) {
|
if (mapRed == NULL) {
|
||||||
free(chanR);
|
free(chanR);
|
||||||
free(chanG);
|
free(chanG);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue