new file mode 100644
@@ -0,0 +1,43 @@
+From 4cf58b781f5b3cf2e02bbc32e8fa455224d4de7f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
+Date: Fri, 28 Apr 2017 10:00:11 +0200
+Subject: [PATCH] subtitle: Fix potential heap buffer overflow
+
+Reported-by: Yannay Livneh <yannayl@checkpoint.com>
+ Omri Herscovici <omrih@checkpoint.com>
+ Omer Gull <omergu@checkpoint.com>
+
+CVE: CVE-2017-8312
+Upstream-Status: Backport [https://code.videolan.org/videolan/vlc/-/commit/611398fc8d32f3fe4331f60b220c52ba3557beaa]
+
+(cherry picked from commit 611398fc8d32f3fe4331f60b220c52ba3557beaa)
+Signed-off-by: Parth Kansara <parth.kansara@einfochips.com>
+---
+ modules/demux/subtitle.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
+index 5d8b6b0763..b201fd8c52 100644
+--- a/modules/demux/subtitle.c
++++ b/modules/demux/subtitle.c
+@@ -1884,7 +1884,7 @@ static int ParseJSS( vlc_object_t *p_obj, subs_properties_t *p_props,
+ case 'S':
+ shift = isalpha( (unsigned char)psz_text[2] ) ? 6 : 2 ;
+ if ( shift > line_length )
+- break;
++ continue;
+
+ if( sscanf( &psz_text[shift], "%d", &h ) )
+ {
+@@ -1923,7 +1923,7 @@ static int ParseJSS( vlc_object_t *p_obj, subs_properties_t *p_props,
+ case 'T':
+ shift = isalpha( (unsigned char)psz_text[2] ) ? 8 : 2 ;
+ if ( shift > line_length )
+- break;
++ continue;
+
+ sscanf( &psz_text[shift], "%d", &p_props->jss.i_time_resolution );
+ if( !p_props->jss.i_time_resolution || p_props->jss.i_time_resolution < 0 )
+--
+2.43.0
+
@@ -23,6 +23,7 @@ SRC_URI = "https://get.videolan.org/${BPN}/${PV}/${BP}.tar.xz \
file://0004-Use-packageconfig-to-detect-mmal-support.patch \
file://0005-ioctl-does-not-have-same-signature-between-glibc-and.patch \
file://0006-configure-Disable-incompatible-function-pointer-type.patch \
+ file://CVE-2017-8312.patch \
"
SRC_URI[sha256sum] = "e7cab503d1d7d5849b89d2cf0e1ee60d0ef6d012407791b644b9cfc0cc225fdf"
inherit autotools-brokensep features_check gettext pkgconfig mime-xdg