aboutsummaryrefslogtreecommitdiffstats
path: root/community/vlc/CVE-2019-13602.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/vlc/CVE-2019-13602.patch')
-rw-r--r--community/vlc/CVE-2019-13602.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/community/vlc/CVE-2019-13602.patch b/community/vlc/CVE-2019-13602.patch
new file mode 100644
index 0000000000..5c2b050be7
--- /dev/null
+++ b/community/vlc/CVE-2019-13602.patch
@@ -0,0 +1,38 @@
+diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
+index edda423..b2e3863 100644
+--- a/modules/demux/mp4/mp4.c
++++ b/modules/demux/mp4/mp4.c
+@@ -421,11 +421,11 @@ static block_t * MP4_EIA608_Convert( block_t * p_block )
+ block_t *p_newblock;
+
+ /* always need at least 10 bytes (atom size+header+1pair)*/
+- if ( i_remaining < 10 ||
+- !(i_bytes = GetDWBE(p_block->p_buffer)) ||
+- (i_bytes > i_remaining) ||
+- memcmp("cdat", &p_block->p_buffer[4], 4) ||
+- !(p_newblock = block_Alloc( i_remaining * 3 - 8 )) )
++ i_bytes = GetDWBE(p_block->p_buffer);
++
++ if (10 < i_bytes || i_bytes < i_remaining ||
++ memcmp("cdat", &p_block->p_buffer[4], 4) ||
++ (p_newblock = block_Alloc(i_remaining * 3 - 8)) == NULL)
+ {
+ p_block->i_buffer = 0;
+ return p_block;
+@@ -447,10 +447,11 @@ static block_t * MP4_EIA608_Convert( block_t * p_block )
+ } while( i_bytes >= 2 );
+
+ /* cdt2 is optional */
+- if ( i_remaining >= 10 &&
+- (i_bytes = GetDWBE(p_read)) &&
+- (i_bytes <= i_remaining) &&
+- !memcmp("cdt2", &p_read[4], 4) )
++ i_bytes = GetDWBE(p_block->p_buffer);
++
++ if (10 < i_bytes || i_bytes < i_remaining ||
++ memcmp("cdat", &p_block->p_buffer[4], 4) ||
++ (p_newblock = block_Alloc(i_remaining * 3 - 8)) == NULL)
+ {
+ p_read += 8;
+ i_bytes -= 8;
+