From: Rémi Denis-Courmont Date: Mon, 7 Jul 2014 16:02:31 +0000 (+0300) Subject: rawvid: fix error handling X-Git-Tag: 3.0.0-git~15592 X-Git-Url: https://git.videolan.org/?p=vlc.git;a=commitdiff_plain;h=4a37004bd7b6e851cc7a75c3d40692298d7a6f11 rawvid: fix error handling --- diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c index f98bafcecc..239f1ca160 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 */