From 4a37004bd7b6e851cc7a75c3d40692298d7a6f11 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 7 Jul 2014 19:02:31 +0300 Subject: [PATCH] rawvid: fix error handling --- 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 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 */ -- 2.20.1