From 4aa3c892b7d404811555e6dc2bdc21ee73be93ea Mon Sep 17 00:00:00 2001 From: Thomas Guillem Date: Thu, 3 Oct 2019 16:02:52 +0200 Subject: [PATCH] tospdif: A52: fix buffer size check 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 5b11cace29..60f3e66544 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.11.4.GIT