fftools/ffmpeg: Check read() for failure

Fixes: CID1591932 Ignoring number of bytes read

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 34fd247c3b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-06-30 22:23:06 +02:00
parent 12df2359e8
commit f015ef3f66
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -492,8 +492,9 @@ static int read_key(void)
}
//Read it
if(nchars != 0) {
read(0, &ch, 1);
return ch;
if (read(0, &ch, 1) == 1)
return ch;
return 0;
}else{
return -1;
}