summaryrefslogtreecommitdiff
path: root/package/libmad/patches/patch-layer3_c
blob: d8e4249de4616d673fa2fbf1769a8c882401c5fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- libmad-0.15.1b.orig/layer3.c	2004-01-23 10:41:32.000000000 +0100
+++ libmad-0.15.1b/layer3.c	2013-10-16 10:51:25.000000000 +0200
@@ -2608,6 +2608,12 @@ int mad_layer_III(struct mad_stream *str
     next_md_begin = 0;
 
   md_len = si.main_data_begin + frame_space - next_md_begin;
+  if (md_len + MAD_BUFFER_GUARD > MAD_BUFFER_MDLEN)
+  {
+	stream->error = MAD_ERROR_LOSTSYNC;
+	stream->sync = 0;
+	return -1;
+  }
 
   frame_used = 0;