[vlc-commits] stream_extractor: archive: do not try to seek beyond entry size

Filip Roséen git at videolan.org
Tue Jul 24 15:42:26 CEST 2018


vlc/vlc-3.0 | branch: master | Filip Roséen <filip at atch.se> | Tue Jul 24 15:07:01 2018 +0200| [e2de3896b9f20a0ac0ab94ce9d2f8bfc99ea7885] | committer: Jean-Baptiste Kempf

stream_extractor: archive: do not try to seek beyond entry size

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 5d3f5afc24f19d4447ae5f0675e7aa6bc74a14f3)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/stream_extractor/archive.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/stream_extractor/archive.c b/modules/stream_extractor/archive.c
index 2b47060f35..788bac0dc4 100644
--- a/modules/stream_extractor/archive.c
+++ b/modules/stream_extractor/archive.c
@@ -624,6 +624,10 @@ static int Seek( stream_extractor_t* p_extractor, uint64_t i_req )
     if( !p_sys->b_seekable_source )
         return VLC_EGENERIC;
 
+    if( archive_entry_size_is_set( p_sys->p_entry ) &&
+        (uint64_t)archive_entry_size( p_sys->p_entry ) < i_req )
+        return VLC_EGENERIC;
+
     if( !p_sys->b_seekable_archive
       || archive_seek_data( p_sys->p_archive, i_req, SEEK_SET ) < 0 )
     {



More information about the vlc-commits mailing list