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

Rémi Denis-Courmont git at videolan.org
Mon Oct 27 20:12:34 CET 2014


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 23 17:58:50 2014 +0300| [18a597c4abbd99e9a59567a4b14dd737bb402797] | committer: Jean-Baptiste Kempf

mjpeg: do not assume that stream_Read() succeeds

(cherry picked from commit f03f44d76a1949f5cbc05989fa1ab257818d245c)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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