From 1b7f873c9ced3daa64bfc9c6ad066aeea09e0447 Mon Sep 17 00:00:00 2001 From: faust3 Date: Sun, 26 Jun 2005 15:15:38 +0000 Subject: [PATCH] 10l git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15818 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_nuv.c | 3 ++- libmpdemux/demux_y4m.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libmpdemux/demux_nuv.c b/libmpdemux/demux_nuv.c index 7e3a6cc340..ce754c51eb 100644 --- a/libmpdemux/demux_nuv.c +++ b/libmpdemux/demux_nuv.c @@ -301,7 +301,8 @@ int nuv_check_file ( demuxer_t* demuxer ) mp_msg ( MSGT_DEMUX, MSGL_V, "Checking for NuppelVideo\n" ); - stream_read(demuxer->stream,(char*)&ns,sizeof(ns)); + if(stream_read(demuxer->stream,(char*)&ns,sizeof(ns)) != sizeof(ns)) + return 0; if ( strncmp ( ns.finfo, "NuppelVideo", 12 ) ) return 0; /* Not a NuppelVideo file */ diff --git a/libmpdemux/demux_y4m.c b/libmpdemux/demux_y4m.c index 8b0b41b5af..4d2b6e5634 100644 --- a/libmpdemux/demux_y4m.c +++ b/libmpdemux/demux_y4m.c @@ -30,7 +30,9 @@ int y4m_check_file(demuxer_t* demuxer){ mp_msg(MSGT_DEMUX, MSGL_V, "Checking for YUV4MPEG2\n"); - stream_read(demuxer->stream, buf, 9); + if(stream_read(demuxer->stream, buf, 9)!=9) + return 0; + buf[9] = 0; if (strncmp("YUV4MPEG2", buf, 9) && strncmp("YUV4MPEG ", buf, 9)) {