ffmpeg | branch: release/4.3 | Michael Niedermayer <[email protected]> | 
Sun Jun 30 22:23:06 2024 +0200| [3eada55c2162a677c4066e6f0d41d58fbe9f6c07] | 
committer: Michael Niedermayer

fftools/ffmpeg: Check read() for failure

Fixes: CID1591932 Ignoring number of bytes read

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Anton Khirnov <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 34fd247c3bf06418c1eaafacf0d6052e3bbe4f5e)
Signed-off-by: Michael Niedermayer <[email protected]>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3eada55c2162a677c4066e6f0d41d58fbe9f6c07
---

 fftools/ffmpeg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index a92c7f20ef..4cb4d9e65b 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -468,8 +468,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;
         }

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to