Re: [FFmpeg-devel] [PATCH 1/2] tests/audiomatch: Add return value check for fread.

2017-12-19 Thread Michael Niedermayer
On Mon, Dec 18, 2017 at 09:41:00AM +0800, Jun Zhao wrote:
> 

>  audiomatch.c |6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> f7cd009b9c616d48223793eeab8d135329a23f69  
> 0001-tests-audiomatch-Add-return-value-check-for-fread.patch
> From a89964e88080d1cc6e01c99bf8640a1020465762 Mon Sep 17 00:00:00 2001
> From: Jun Zhao 
> Date: Mon, 18 Dec 2017 08:59:58 +0800
> Subject: [PATCH 1/2] tests/audiomatch: Add return value check for fread.
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> Check fread return value to fix build warning as "ignoring
> return value of ‘fread’"
> 
> Signed-off-by: Jun Zhao 
> ---
>  tests/audiomatch.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

will apply

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Elect your leaders based on what they did after the last election, not
based on what they say before an election.



signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] tests/audiomatch: Add return value check for fread.

2017-12-17 Thread Jun Zhao

From a89964e88080d1cc6e01c99bf8640a1020465762 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Mon, 18 Dec 2017 08:59:58 +0800
Subject: [PATCH 1/2] tests/audiomatch: Add return value check for fread.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Check fread return value to fix build warning as "ignoring
return value of ‘fread’"

Signed-off-by: Jun Zhao 
---
 tests/audiomatch.c | 6 --
 1 file 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;
 
-- 
2.14.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel