diff mbox

[FFmpeg-devel] tests/api-h264-slice-test: fread returns size_t, not ssize_t.

Message ID CAB0OVGosBGh_j0TGi-vxm-c+_nXY7N9HbbONnrZ-vbhY2aoRKA@mail.gmail.com
State Superseded
Headers show

Commit Message

Carl Eugen Hoyos Oct. 29, 2018, 9:14 p.m. UTC
Hi!

Attached untested patch is supposed to fix ticket #7521.

Please comment, Carl Eugen
diff mbox

Patch

From ad5a9de93a8cfe261636993532246befddea984d Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Mon, 29 Oct 2018 22:11:54 +0100
Subject: [PATCH] tests/api-h264-slice-test: fread returns size_t, not
 ssize_t.

Fixes ticket #7521.
---
 tests/api/api-h264-slice-test.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/api/api-h264-slice-test.c b/tests/api/api-h264-slice-test.c
index 57e7dc7..9ca30dc 100644
--- a/tests/api/api-h264-slice-test.c
+++ b/tests/api/api-h264-slice-test.c
@@ -180,15 +180,15 @@  int main(int argc, char **argv)
 
     while(1) {
         uint16_t size = 0;
-        ssize_t ret = fread(&size, 1, sizeof(uint16_t), fd);
-        if (ret < 0) {
+        size_t ret = fread(&size, 1, sizeof(uint16_t), fd);
+        if (!ret) {
             perror("Couldn't read size");
             exit(1);
         } else if (ret != sizeof(uint16_t))
             break;
         size = ntohs(size);
         ret = fread(p, 1, size, fd);
-        if (ret < 0 || ret != size) {
+        if (ret != size) {
             perror("Couldn't read data");
             exit(1);
         }
-- 
1.7.10.4