[vlc-devel] [PATCH 5/9] tospdif: A52: fix buffer size check

Thomas Guillem thomas at gllm.fr
Thu Oct 3 16:33:55 CEST 2019


When an AC-3 Core + EAC3 ext (gathered from the packetizer) block was passed,
the buffer size was equal to a52_size and didn't triggered the a52 reparse that
removed the EAC3 extension.
---
 modules/audio_filter/converter/tospdif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/audio_filter/converter/tospdif.c b/modules/audio_filter/converter/tospdif.c
index d40d62f1f2..b28a5f9ba4 100644
--- a/modules/audio_filter/converter/tospdif.c
+++ b/modules/audio_filter/converter/tospdif.c
@@ -219,7 +219,7 @@ static int write_buffer_ac3( filter_t *p_filter, block_t *p_in_buf )
     static const size_t a52_size = A52_FRAME_NB * 4;
 
     if( unlikely( p_in_buf->i_buffer < 6
-     || p_in_buf->i_buffer > a52_size
+     || p_in_buf->i_buffer + SPDIF_HEADER_SIZE > a52_size
      || p_in_buf->i_nb_samples != A52_FRAME_NB ) )
     {
         /* Input is not correctly packetizer. Try to parse the buffer in order
-- 
2.20.1



More information about the vlc-devel mailing list