[vlc-commits] demux: adaptive: fix PKCS7 padding

Francois Cartegnie git at videolan.org
Wed Jun 5 17:12:53 CEST 2019


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jun  5 17:11:10 2019 +0200| [6e156ad2eae246fafcefc0e88df60bfadaeb4771] | committer: Francois Cartegnie

demux: adaptive: fix PKCS7 padding

cherry-picked from a968e4f071032d089da2601e9238d8100c1fac74

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=6e156ad2eae246fafcefc0e88df60bfadaeb4771
---

 modules/demux/hls/playlist/HLSSegment.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/hls/playlist/HLSSegment.cpp b/modules/demux/hls/playlist/HLSSegment.cpp
index 57b3639052..7afb239e16 100644
--- a/modules/demux/hls/playlist/HLSSegment.cpp
+++ b/modules/demux/hls/playlist/HLSSegment.cpp
@@ -106,12 +106,12 @@ void HLSSegment::onChunkDownload(block_t **pp_block, SegmentChunk *chunk, BaseRe
                 {
                     /* remove the PKCS#7 padding from the buffer */
                     const uint8_t pad = p_block->p_buffer[p_block->i_buffer - 1];
-                    for(uint8_t i=0; i<pad && i<=16; i++)
+                    for(uint8_t i=0; i<pad && i<16; i++)
                     {
                         if(p_block->p_buffer[p_block->i_buffer - i - 1] != pad)
                             break;
 
-                        if(i==pad)
+                        if(i+1==pad)
                             p_block->i_buffer -= pad;
                     }
 



More information about the vlc-commits mailing list