diff options
author | Jun Zhao <jun.zhao@intel.com> | 2017-12-18 08:59:58 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-12-19 21:32:04 +0100 |
commit | 2b38900cb377c56d855807012d931c7c40d215ed (patch) | |
tree | 090a35386a1a4124695f2faa6ce30aea2ebf6387 /tests/audiomatch.c | |
parent | c12c2739cd1eb3a84177a1dd39b526cbd5400927 (diff) | |
download | ffmpeg-2b38900cb377c56d855807012d931c7c40d215ed.tar.gz |
tests/audiomatch: Add return value check for fread.
Check fread return value to fix build warning as "ignoring
return value of ‘fread’"
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'tests/audiomatch.c')
-rw-r--r-- | tests/audiomatch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/audiomatch.c b/tests/audiomatch.c index ca56df09b3..e63e494add 100644 --- a/tests/audiomatch.c +++ b/tests/audiomatch.c @@ -80,8 +80,10 @@ int main(int argc, char **argv){ data = malloc(datlen * sizeof(*data)); signal = malloc(siglen * sizeof(*signal)); - fread(data , 1, datlen, f[0]); - fread(signal, 1, siglen, f[1]); + if (fread(data , 1, datlen, f[0]) != datlen) + return 1; + if (fread(signal, 1, siglen, f[1]) != siglen) + return 1; datlen /= 2; siglen /= 2; |