diff options
| author | mayeut <mayeut@users.noreply.github.com> | 2015-07-26 02:41:39 +0200 |
|---|---|---|
| committer | mayeut <mayeut@users.noreply.github.com> | 2015-07-26 02:41:39 +0200 |
| commit | c423cc84e7be79051a7f9631fa26aa7d072361f2 (patch) | |
| tree | 98d92f8501df77e5510c69eb4db6f1fab20b9855 /src/bin/jp2/convertbmp.c | |
| parent | d87de3a88da9a405a06e8d1e3b3d5d8b3e935ba2 (diff) | |
Remove some warnings when building
Update #442
Diffstat (limited to 'src/bin/jp2/convertbmp.c')
| -rw-r--r-- | src/bin/jp2/convertbmp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/jp2/convertbmp.c b/src/bin/jp2/convertbmp.c index 78ca0329..9d779b39 100644 --- a/src/bin/jp2/convertbmp.c +++ b/src/bin/jp2/convertbmp.c @@ -440,7 +440,10 @@ static OPJ_BOOL bmp_read_info_header(FILE* IN, OPJ_BITMAPINFOHEADER* header) header->biColorSpaceType |= (OPJ_UINT32)(getc(IN) << 16); header->biColorSpaceType |= (OPJ_UINT32)(getc(IN) << 24); - fread(&(header->biColorSpaceEP), 1U, sizeof(header->biColorSpaceEP), IN); + if (fread(&(header->biColorSpaceEP), 1U, sizeof(header->biColorSpaceEP), IN) != sizeof(header->biColorSpaceEP)) { + fprintf(stderr,"Error, can't read BMP header\n"); + return OPJ_FALSE; + } header->biRedGamma = (OPJ_UINT32)getc(IN); header->biRedGamma |= (OPJ_UINT32)(getc(IN) << 8); |
