[vlc-commits] demux: avi: fix OpenDML regression
Francois Cartegnie
git at videolan.org
Fri Apr 13 09:52:25 CEST 2018
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Mar 6 12:20:42 2018 +0100| [a13ec28b49d01aa2f8f439a2b389b740371b72b9] | committer: Hugo Beauzée-Luyssen
demux: avi: fix OpenDML regression
while avi and chunks are 32bits, opendml
can extend offsets to 64bits
(cherry picked from commit 0fc5a07cc5f284425de7c3dc2be38968626b521f)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=a13ec28b49d01aa2f8f439a2b389b740371b72b9
---
modules/demux/avi/avi.c | 32 ++++++++++++++++----------------
modules/demux/avi/libavi.h | 2 +-
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 8dab8f776d..8e43a9d0f8 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -106,7 +106,7 @@ static char *FromACP( const char *str )
typedef struct
{
vlc_fourcc_t i_fourcc;
- uint32_t i_pos;
+ uint64_t i_pos;
uint32_t i_size;
vlc_fourcc_t i_type; /* only for AVIFOURCC_LIST */
@@ -121,9 +121,9 @@ typedef struct
{
vlc_fourcc_t i_id;
uint32_t i_flags;
- uint32_t i_pos;
+ uint64_t i_pos;
uint32_t i_length;
- int64_t i_lengthtotal;
+ uint64_t i_lengthtotal;
} avi_entry_t;
@@ -136,7 +136,7 @@ typedef struct
} avi_index_t;
static void avi_index_Init( avi_index_t * );
static void avi_index_Clean( avi_index_t * );
-static void avi_index_Append( avi_index_t *, uint32_t *, avi_entry_t * );
+static void avi_index_Append( avi_index_t *, uint64_t *, avi_entry_t * );
typedef struct
{
@@ -184,8 +184,8 @@ struct demux_sys_t
bool b_odml;
- uint32_t i_movi_begin;
- uint32_t i_movi_lastchunk_pos; /* XXX position of last valid chunk */
+ uint64_t i_movi_begin;
+ uint64_t i_movi_lastchunk_pos; /* XXX position of last valid chunk */
/* number of streams and information */
unsigned int i_track;
@@ -213,7 +213,7 @@ static int AVI_StreamChunkFind( demux_t *, unsigned int i_stream );
static int AVI_StreamChunkSet ( demux_t *,
unsigned int i_stream, unsigned int i_ck );
static int AVI_StreamBytesSet ( demux_t *,
- unsigned int i_stream, uint32_t i_byte );
+ unsigned int i_stream, uint64_t i_byte );
vlc_fourcc_t AVI_FourccGetCodec( unsigned int i_cat, vlc_fourcc_t );
static int AVI_GetKeyFlag ( vlc_fourcc_t , uint8_t * );
@@ -1538,7 +1538,7 @@ static int Seek( demux_t *p_demux, mtime_t i_date, int i_percent, bool b_accurat
if( p_sys->b_seekable )
{
- int64_t i_pos_backup = vlc_stream_Tell( p_demux->s );
+ uint64_t i_pos_backup = vlc_stream_Tell( p_demux->s );
/* Check and lazy load indexes if it was not done (not fastseekable) */
if ( !p_sys->b_indexloaded && ( p_sys->i_avih_flags & AVIF_HASINDEX ) )
@@ -1566,7 +1566,7 @@ static int Seek( demux_t *p_demux, mtime_t i_date, int i_percent, bool b_accurat
{
avi_track_t *p_stream = NULL;
unsigned i_stream = 0;
- int64_t i_pos;
+ uint64_t i_pos;
if ( !p_sys->i_movi_lastchunk_pos && /* set when index is successfully loaded */
! ( p_sys->i_avih_flags & AVIF_ISINTERLEAVED ) )
@@ -1991,7 +1991,7 @@ static int AVI_StreamChunkSet( demux_t *p_demux, unsigned int i_stream,
/* XXX FIXME up to now, we assume that all chunk are one after one */
static int AVI_StreamBytesSet( demux_t *p_demux,
unsigned int i_stream,
- uint32_t i_byte )
+ uint64_t i_byte )
{
demux_sys_t *p_sys = p_demux->p_sys;
avi_track_t *p_stream = p_sys->track[i_stream];
@@ -2368,7 +2368,7 @@ static void avi_index_Clean( avi_index_t *p_index )
{
free( p_index->p_entry );
}
-static void avi_index_Append( avi_index_t *p_index, uint32_t *pi_last_pos,
+static void avi_index_Append( avi_index_t *p_index, uint64_t *pi_last_pos,
avi_entry_t *p_entry )
{
/* Update last chunk position */
@@ -2465,7 +2465,7 @@ static int AVI_IndexFind_idx1( demux_t *p_demux,
}
static int AVI_IndexLoad_idx1( demux_t *p_demux,
- avi_index_t p_index[], uint32_t *pi_last_offset )
+ avi_index_t p_index[], uint64_t *pi_last_offset )
{
demux_sys_t *p_sys = p_demux->p_sys;
@@ -2521,7 +2521,7 @@ static int AVI_IndexLoad_idx1( demux_t *p_demux,
return VLC_SUCCESS;
}
-static void __Parse_indx( demux_t *p_demux, avi_index_t *p_index, uint32_t *pi_max_offset,
+static void __Parse_indx( demux_t *p_demux, avi_index_t *p_index, uint64_t *pi_max_offset,
avi_chunk_indx_t *p_indx )
{
avi_entry_t index;
@@ -2562,7 +2562,7 @@ static void __Parse_indx( demux_t *p_demux, avi_index_t *p_index, uint32_t *pi_m
}
static void AVI_IndexLoad_indx( demux_t *p_demux,
- avi_index_t p_index[], uint32_t *pi_last_offset )
+ avi_index_t p_index[], uint64_t *pi_last_offset )
{
demux_sys_t *p_sys = p_demux->p_sys;
@@ -2632,8 +2632,8 @@ static void AVI_IndexLoad( demux_t *p_demux )
avi_index_Init( &p_idx_indx[i] );
avi_index_Init( &p_idx_idx1[i] );
}
- uint32_t i_indx_last_pos = p_sys->i_movi_lastchunk_pos;
- uint32_t i_idx1_last_pos = p_sys->i_movi_lastchunk_pos;
+ uint64_t i_indx_last_pos = p_sys->i_movi_lastchunk_pos;
+ uint64_t i_idx1_last_pos = p_sys->i_movi_lastchunk_pos;
AVI_IndexLoad_indx( p_demux, p_idx_indx, &i_indx_last_pos );
if( !p_sys->b_odml )
diff --git a/modules/demux/avi/libavi.h b/modules/demux/avi/libavi.h
index 26e1614a12..785f4dfc13 100644
--- a/modules/demux/avi/libavi.h
+++ b/modules/demux/avi/libavi.h
@@ -225,7 +225,7 @@ typedef struct avi_chunk_indx_s
uint32_t i_entriesinuse;
vlc_fourcc_t i_id;
- int64_t i_baseoffset;
+ uint64_t i_baseoffset;
union
{
More information about the vlc-commits
mailing list