[vlc-commits] rawvid: fix error handling

Rémi Denis-Courmont git at videolan.org
Mon Jul 7 18:31:06 CEST 2014


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul  7 19:02:31 2014 +0300| [551956d384e830af1f45085589258faf38de1f8c] | committer: Jean-Baptiste Kempf

rawvid: fix error handling

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

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

 modules/demux/rawvid.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c
index f98bafc..239f1ca 100644
--- a/modules/demux/rawvid.c
+++ b/modules/demux/rawvid.c
@@ -190,13 +190,14 @@ valid:
     /* override presets if yuv4mpeg2 */
     if( b_y4m )
     {
+        /* The string should start with "YUV4MPEG2" */
         char *psz = stream_ReadLine( p_demux->s );
         char *psz_buf;
         int a = 1;
         int b = 1;
 
-        /* The string will start with "YUV4MPEG2" */
-        assert( strlen(psz) >= 9 );
+        if( unlikely(psz == NULL) )
+            goto error;
 
         /* NB, it is not possible to handle interlaced here, since the
          * interlaced picture flags are in picture_t not block_t */



More information about the vlc-commits mailing list