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 34fd247c3bf06418c1eaafacf0d6052e3bbe4f5e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
1e1a0182f7
commit
afe53194ac
@ -491,8 +491,9 @@ static int read_key(void)
|
|||||||
}
|
}
|
||||||
//Read it
|
//Read it
|
||||||
if(nchars != 0) {
|
if(nchars != 0) {
|
||||||
read(0, &ch, 1);
|
if (read(0, &ch, 1) == 1)
|
||||||
return ch;
|
return ch;
|
||||||
|
return 0;
|
||||||
}else{
|
}else{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user