[vlc-commits] mjpeg: do not assume that stream_Read() succeeds

Rémi Denis-Courmont git at videolan.org
Thu Oct 23 16:59:16 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 23 17:58:50 2014 +0300| [f03f44d76a1949f5cbc05989fa1ab257818d245c] | committer: Rémi Denis-Courmont

mjpeg: do not assume that stream_Read() succeeds

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f03f44d76a1949f5cbc05989fa1ab257818d245c
---

 modules/demux/mjpeg.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c
index 2c076ad..af6fcea 100644
--- a/modules/demux/mjpeg.c
+++ b/modules/demux/mjpeg.c
@@ -462,7 +462,8 @@ static int MimeDemux( demux_t *p_demux )
 
     if( i_size > 0 )
     {
-        stream_Read( p_demux->s, NULL, i_size );
+        if( stream_Read( p_demux->s, NULL, i_size ) != i_size )
+            return 0;
     }
     else if( i_size < 0 )
     {



More information about the vlc-commits mailing list