[vlc-devel] [vlc-commits] demux: libavi: use parent for boundary check on chunk read

Rémi Denis-Courmont remi at remlab.net
Wed Nov 22 07:29:30 CET 2017


Le 21 novembre 2017 19:32:56 GMT+02:00, Francois Cartegnie <git at videolan.org> a écrit :
>vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov
>21 13:54:51 2017 +0100| [28e5cd0e0573acd9a7e05e2bc1119b8813728f42] |
>committer: Francois Cartegnie
>
>demux: libavi: use parent for boundary check on chunk read
>
>>
>http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=28e5cd0e0573acd9a7e05e2bc1119b8813728f42
>---
>
> modules/demux/avi/libavi.c | 37 ++++++++++++++++++++-----------------
> 1 file changed, 20 insertions(+), 17 deletions(-)
>
>diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
>index 38c938a5fc..ade9ac8af5 100644
>--- a/modules/demux/avi/libavi.c
>+++ b/modules/demux/avi/libavi.c
>@@ -94,21 +108,13 @@ static int AVI_NextChunk( stream_t *s, avi_chunk_t
>*p_chk )
> 
>     if( !p_chk )
>     {
>-        if( AVI_ChunkReadCommon( s, &chk ) )
>+        if( AVI_ChunkReadCommon( s, &chk, p_chk->common.p_father ) )

NULL dereference (found by Coverity).

>         {
>             return VLC_EGENERIC;
>         }
>         p_chk = &chk;
>     }
> 
>-    if( p_chk->common.p_father )
>-    {
>-        if( AVI_ChunkEnd( p_chk->common.p_father ) < AVI_ChunkEnd(
>p_chk ) )
>-        {
>-            return VLC_EGENERIC;
>-        }
>-    }
>-
>     bool b_seekable = false;
>     const uint64_t i_offset = AVI_ChunkEnd( p_chk );
>if ( !vlc_stream_Control(s, STREAM_CAN_SEEK, &b_seekable) && b_seekable
>)
>@@ -200,8 +206,8 @@ static int AVI_ChunkRead_list( stream_t *s,
>avi_chunk_t *p_container )
>         {
>             break;
>         }
>-        if( p_chk->common.p_father->common.i_chunk_size > 0 &&
>-            vlc_stream_Tell( s ) >= AVI_ChunkEnd(
>p_chk->common.p_father ) )
>+        if( p_container->common.i_chunk_size > 0 &&
>+            vlc_stream_Tell( s ) >= AVI_ChunkEnd( p_container ) )
>         {
>             break;
>         }
>@@ -972,11 +978,8 @@ int  AVI_ChunkRead( stream_t *s, avi_chunk_t
>*p_chk, avi_chunk_t *p_father )
>         return VLC_EGENERIC;
>     }
> 
>-    if( AVI_ChunkReadCommon( s, p_chk ) )
>-    {
>-        msg_Warn( (vlc_object_t*)s, "cannot read one chunk" );
>+    if( AVI_ChunkReadCommon( s, p_chk, p_father ) )
>         return VLC_EGENERIC;
>-    }
> 
>     if( p_chk->common.i_chunk_fourcc == VLC_FOURCC( 0, 0, 0, 0 ) )
>     {
>
>_______________________________________________
>vlc-commits mailing list
>vlc-commits at videolan.org
>https://mailman.videolan.org/listinfo/vlc-commits


-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


More information about the vlc-devel mailing list