Fix fd leak

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1956 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
focus
2011-12-08 14:27:25 +00:00
parent b38e7d70f3
commit 3a414300b8

View File

@@ -89,7 +89,7 @@ int fh_bmp_load(const char *name,unsigned char **buffer,int* xp,int* yp)
switch (bpp){ switch (bpp){
case 1: /* monochrome */ case 1: /* monochrome */
skip = fill4B(x/8+(x%8?1:0)); skip = fill4B(x/8 + ((x%8) ? 1 : 0));
lseek(fd, raster, SEEK_SET); lseek(fd, raster, SEEK_SET);
{ {
int bytes=x/8; int bytes=x/8;
@@ -210,6 +210,7 @@ int fh_bmp_load(const char *name,unsigned char **buffer,int* xp,int* yp)
} }
break; break;
case 16: /* 16bit RGB */ case 16: /* 16bit RGB */
close(fd);
return(FH_ERROR_FORMAT); return(FH_ERROR_FORMAT);
break; break;
case 24: /* 24bit RGB */ case 24: /* 24bit RGB */
@@ -232,6 +233,7 @@ int fh_bmp_load(const char *name,unsigned char **buffer,int* xp,int* yp)
} }
break; break;
default: default:
close(fd);
return(FH_ERROR_FORMAT); return(FH_ERROR_FORMAT);
} }