less magic trick in fpga_compress for coverity

This commit is contained in:
Philippe Teuwen 2019-10-05 12:43:46 +02:00
parent 7d009a9ea7
commit a5001de76c

View file

@ -275,11 +275,15 @@ static int bitparse_find_section(FILE *infile, char section_name, unsigned int *
/* Four byte length field */
current_length += fgetc(infile) << 24;
current_length += fgetc(infile) << 16;
numbytes += 2;
current_length += fgetc(infile) << 8;
current_length += fgetc(infile) << 0;
numbytes += 4;
break;
default: /* Fall through, two byte length field */
current_length += fgetc(infile) << 8;
current_length += fgetc(infile) << 0;
numbytes += 2;
break;
}
if (current_name != 'e' && current_length > 255) {