diff options
-rw-r--r-- | libmpdemux/demux_nuv.c | 3 | ||||
-rw-r--r-- | 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)) { |