[FFmpeg-cvslog] rotozoom: Check return value of fread().

Diego Biurrun git at videolan.org
Thu May 12 04:55:11 CEST 2011


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Mon May  9 12:42:15 2011 +0200| [cbb0930f0ebdb2655296d7ae4424ee922168c5b7] | committer: Diego Biurrun

rotozoom: Check return value of fread().

This fixes the warnings:
tests/rotozoom.c:252: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
tests/rotozoom.c:254: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cbb0930f0ebdb2655296d7ae4424ee922168c5b7
---

 tests/rotozoom.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/rotozoom.c b/tests/rotozoom.c
index 644ae8b..d61ce21 100644
--- a/tests/rotozoom.c
+++ b/tests/rotozoom.c
@@ -249,9 +249,11 @@ static int init_demo(const char *filename)
         return 1;
     }
 
-    fread(line, 1, 15, fichier);
+    if (fread(line, 1, 15, fichier) != 15)
+        return 1;
     for (i = 0; i < H; i++) {
-        fread(line, 1, 3 * W, fichier);
+        if (fread(line, 1, 3 * W, fichier) != 3 * W)
+            return 1;
         for (j = 0; j < W; j++) {
             tab_r[W * i + j] = line[3 * j    ];
             tab_g[W * i + j] = line[3 * j + 1];



More information about the ffmpeg-cvslog mailing list