From c15f20bd772487d863f01a2813a3ab45b1f11a6b Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 27 Apr 2014 23:23:49 +0200 Subject: [PATCH] opencl: Check return value of fread() common/opencl.c:138:10: warning: ignoring return value of 'fread', declared with attribute warn_unused_result [-Wunused-result] --- common/opencl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/opencl.c b/common/opencl.c index 9e5e7941..8b223b4c 100644 --- a/common/opencl.c +++ b/common/opencl.c @@ -135,7 +135,8 @@ static cl_program x264_opencl_cache_load( x264_t *h, const char *dev_name, const rewind( fp ); CHECKED_MALLOC( binary, size ); - fread( binary, 1, size, fp ); + if ( fread( binary, 1, size, fp ) != size ) + goto fail; const uint8_t *ptr = (const uint8_t*)binary; #define CHECK_STRING( STR )\ -- 2.50.1