mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-19 21:06:42 +00:00
tools/cws2fws: Check read() for failure
Fixes: CID1452579 Argument cannot be negative
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0b3cdd7cc2
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
26cd140d0c
commit
1aa91dc78f
@ -89,6 +89,12 @@ int main(int argc, char *argv[])
|
|||||||
for (i = 0; i < comp_len - 8;) {
|
for (i = 0; i < comp_len - 8;) {
|
||||||
int ret, len = read(fd_in, &buf_in, 1024);
|
int ret, len = read(fd_in, &buf_in, 1024);
|
||||||
|
|
||||||
|
if (len == -1) {
|
||||||
|
printf("read failure\n");
|
||||||
|
inflateEnd(&zstream);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
dbgprintf("read %d bytes\n", len);
|
dbgprintf("read %d bytes\n", len);
|
||||||
|
|
||||||
last_out = zstream.total_out;
|
last_out = zstream.total_out;
|
||||||
|
Loading…
Reference in New Issue
Block a user