diff options
author | Michal Krol <[email protected]> | 2010-03-10 15:49:30 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2010-03-10 15:49:30 +0100 |
commit | 3ce4375912c8ea488460e593e07c5bb15b92dca9 (patch) | |
tree | 1011fa439bd829fd46a44fd99478135848800e73 /progs/redbook/convolution.c | |
parent | f59f28093ea827bd234d8e1a36bdd56a9fce5f09 (diff) | |
parent | 9b348d0ed125a22be3f318ac60cef6f201edfdab (diff) |
Merge branch 'master' into gallium-sampler-view
Conflicts:
src/gallium/auxiliary/Makefile
src/gallium/auxiliary/SConscript
src/gallium/auxiliary/tgsi/tgsi_exec.c
src/gallium/auxiliary/util/u_blitter.c
src/gallium/drivers/i915/i915_context.h
src/gallium/drivers/i965/brw_context.h
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/nv50/nv50_context.h
src/gallium/drivers/nv50/nv50_state_validate.c
src/gallium/drivers/nv50/nv50_tex.c
src/gallium/drivers/r300/r300_blit.c
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/softpipe/sp_context.h
src/gallium/drivers/svga/svga_context.h
src/gallium/drivers/svga/svga_pipe_sampler.c
Diffstat (limited to 'progs/redbook/convolution.c')
-rw-r--r-- | progs/redbook/convolution.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/progs/redbook/convolution.c b/progs/redbook/convolution.c index 0898ef25e10..c04a8727a71 100644 --- a/progs/redbook/convolution.c +++ b/progs/redbook/convolution.c @@ -75,6 +75,7 @@ readImage( const char* filename, GLsizei* width, GLsizei *height ) { int n; GLubyte* pixels; + size_t num_read; FILE* infile = fopen( filename, "rb" ); @@ -83,8 +84,10 @@ readImage( const char* filename, GLsizei* width, GLsizei *height ) exit(1); } - fread( width, sizeof( GLsizei ), 1, infile ); - fread( height, sizeof( GLsizei ), 1, infile ); + num_read = fread( width, sizeof( GLsizei ), 1, infile ); + assert(num_read == 1); + num_read = fread( height, sizeof( GLsizei ), 1, infile ); + assert(num_read == 1); *width = bswap(*width); *height = bswap(*height); @@ -101,7 +104,8 @@ readImage( const char* filename, GLsizei* width, GLsizei *height ) return NULL; } - fread( pixels, sizeof( GLubyte ), n, infile ); + num_read = fread( pixels, sizeof( GLubyte ), n, infile ); + assert(num_read == n); fclose( infile ); |