[FFmpeg-cvslog] fate/api-h264-slice-test: don't use ssize_t
Josh de Kock
git at videolan.org
Sat Nov 3 17:58:40 EET 2018
ffmpeg | branch: release/4.1 | Josh de Kock <joshdk at obe.tv> | Tue Oct 30 14:38:41 2018 +0000| [5060a615c7389808a4006e2d3e9acb9562d6ebec] | committer: James Almer
fate/api-h264-slice-test: don't use ssize_t
Fixes ticket #7521
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit 8096f52049acb1861645815a54435b9fd2d5e77a)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5060a615c7389808a4006e2d3e9acb9562d6ebec
---
tests/api/api-h264-slice-test.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/tests/api/api-h264-slice-test.c b/tests/api/api-h264-slice-test.c
index 57e7dc79c3..e68fa6e252 100644
--- a/tests/api/api-h264-slice-test.c
+++ b/tests/api/api-h264-slice-test.c
@@ -180,15 +180,12 @@ 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) {
- perror("Couldn't read size");
- exit(1);
- } else if (ret != sizeof(uint16_t))
+ size_t ret = fread(&size, 1, sizeof(uint16_t), fd);
+ 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);
}
More information about the ffmpeg-cvslog
mailing list