[vlc-commits] demux: minibox: fix dead loop

Francois Cartegnie git at videolan.org
Tue Jan 2 17:19:04 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan  2 16:47:52 2018 +0100| [5cd17d1723bd653be81f420ab4ece49383f5e15d] | committer: Francois Cartegnie

demux: minibox: fix dead loop

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

 modules/codec/substx3g.c    | 3 ++-
 modules/demux/mp4/minibox.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/codec/substx3g.c b/modules/codec/substx3g.c
index f20ba89016..cb651112d3 100644
--- a/modules/codec/substx3g.c
+++ b/modules/codec/substx3g.c
@@ -369,7 +369,8 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
     subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
 
     mp4_box_iterator_t it;
-    mp4_box_iterator_Init( &it, p_block->p_buffer, p_block->i_buffer );
+    mp4_box_iterator_Init( &it, p_buf,
+                           p_block->i_buffer - (p_buf - p_block->p_buffer) );
     /* Parse our styles */
     while( mp4_box_iterator_Next( &it ) )
     {
diff --git a/modules/demux/mp4/minibox.h b/modules/demux/mp4/minibox.h
index 5204ef529c..854c3e0ac2 100644
--- a/modules/demux/mp4/minibox.h
+++ b/modules/demux/mp4/minibox.h
@@ -50,6 +50,7 @@ static bool mp4_box_iterator_Next( mp4_box_iterator_t *p_it )
             p_it->i_buffer -= i_size;
             return true;
         }
+        else break;
     }
     return false;
 }



More information about the vlc-commits mailing list