[FFmpeg-devel] [PATCH] ffmpeg: check tcgetattr result.

Michael Niedermayer michaelni at gmx.at
Tue Jan 17 04:01:14 CET 2012


On Tue, Jan 17, 2012 at 12:11:44AM +0100, Reimar Döffinger wrote:
> This fixes parallel FATE (make fate -j4) failing under valgrind with:
>  Syscall param ioctl(TCSET{S,SW,SF}) points to uninitialised byte(s)
>     at 0x5D98B23: tcsetattr (tcsetattr.c:88)
>     by 0x43D66C: term_init (ffmpeg.c:734)
>     by 0x43CD8D: main (ffmpeg.c:5071)
>   Address 0x7fefffdd0 is on thread 1's stack
>   Uninitialised value was created by a stack allocation
>     at 0x43D5B0: term_init (ffmpeg.c:716)
> 
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

> ---
>  ffmpeg.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 434302d..3880f35 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -718,7 +718,7 @@ static void term_init(void)
>      if(!run_as_daemon){
>      struct termios tty;
>  
> -    tcgetattr (0, &tty);
> +    if (tcgetattr (0, &tty) == 0) {
>      oldtty = tty;

if this doesnt get executed
term_exit would use a 0 oldtty, iam not sure what that would do but
it doesnt feel right


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120117/31530123/attachment.asc>


More information about the ffmpeg-devel mailing list