Web hosting ecommerce - Page 416 OpenGL Super Bible! * Couldn’t allocate

Page 416 OpenGL Super Bible! * Couldn’t allocate memory for bitmap info - return NULL */ fclose(fp); return (NULL); }; if (fread(*info, 1, infosize, fp) < infosize) { /* * Couldn't read the bitmap header - return NULL */ free(*info); fclose(fp); return (NULL); }; /* * Now that we have all the header info read in, allocate memory for the * bitmap and read *it* in */ if ((bitsize = (*info)->bmiHeader.biSizeImage) == 0) bitsize = ((*info)->bmiHeader.biWidth * (*info)->bmiHeader.biBitCount + 7) / 8 * abs((*info)->bmiHeader.biHeight); if ((bits = malloc(bitsize)) == NULL) { /* * Couldn’t allocate memory - return NULL! */ free(*info); fclose(fp); return (NULL); }; if (fread(bits, 1, bitsize, fp) < bitsize) { /* * Couldn't read bitmap - free memory and return NULL! */ free(*info); free(bits); fclose(fp); return (NULL); }; /* * OK, everything went fine - return the allocated bitmap */
Check Tomcat Web Hosting services for best quality webspace to host your web application.

Leave a Reply