Commit be95ddf5 authored by Laurent Aimar's avatar Laurent Aimar

* plugins/avi/avi.c try to not freeze when reach end file

parent 5c983d98
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libioRIFF.c : AVI file Stream input module for vlc * libioRIFF.c : AVI file Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: libioRIFF.c,v 1.4 2002/05/04 16:51:05 fenrir Exp $ * $Id: libioRIFF.c,v 1.5 2002/05/05 17:20:49 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -128,7 +128,6 @@ static riffchunk_t * RIFF_ReadChunk(input_thread_t * p_input) ...@@ -128,7 +128,6 @@ static riffchunk_t * RIFF_ReadChunk(input_thread_t * p_input)
if((p_riff = malloc( sizeof(riffchunk_t))) == NULL) if((p_riff = malloc( sizeof(riffchunk_t))) == NULL)
{ {
intf_ErrMsg("input error: not enough memory (ioriff)" );
return NULL; return NULL;
} }
...@@ -139,7 +138,6 @@ static riffchunk_t * RIFF_ReadChunk(input_thread_t * p_input) ...@@ -139,7 +138,6 @@ static riffchunk_t * RIFF_ReadChunk(input_thread_t * p_input)
count=input_Peek( p_input, &p_peek, 12 ); count=input_Peek( p_input, &p_peek, 12 );
if( count < 8 ) if( count < 8 )
{ {
intf_ErrMsg( "input error: cannot peek() (ioriff)" );
free(p_riff); free(p_riff);
return NULL; return NULL;
} }
...@@ -171,7 +169,6 @@ static int RIFF_NextChunk( input_thread_t * p_input,riffchunk_t *p_rifffather) ...@@ -171,7 +169,6 @@ static int RIFF_NextChunk( input_thread_t * p_input,riffchunk_t *p_rifffather)
if( ( p_riff = RIFF_ReadChunk( p_input ) ) == NULL ) if( ( p_riff = RIFF_ReadChunk( p_input ) ) == NULL )
{ {
intf_ErrMsg( "ioriff: cannot read chunk." );
return( -1 ); return( -1 );
} }
i_len = p_riff->i_size; i_len = p_riff->i_size;
...@@ -181,9 +178,8 @@ static int RIFF_NextChunk( input_thread_t * p_input,riffchunk_t *p_rifffather) ...@@ -181,9 +178,8 @@ static int RIFF_NextChunk( input_thread_t * p_input,riffchunk_t *p_rifffather)
{ {
i_lenfather=p_rifffather->i_size; i_lenfather=p_rifffather->i_size;
if ( i_lenfather%2 !=0 ) {i_lenfather++;} if ( i_lenfather%2 !=0 ) {i_lenfather++;}
if ( p_rifffather->i_pos + i_lenfather <= p_riff->i_pos + i_len ) if ( p_rifffather->i_pos + i_lenfather <= p_riff->i_pos + i_len + 8 )
{ {
intf_ErrMsg( "ioriff: next chunk out of bound" );
free( p_riff ); free( p_riff );
return( 1 ); /* pas dans nos frontiere */ return( 1 ); /* pas dans nos frontiere */
} }
...@@ -191,7 +187,6 @@ static int RIFF_NextChunk( input_thread_t * p_input,riffchunk_t *p_rifffather) ...@@ -191,7 +187,6 @@ static int RIFF_NextChunk( input_thread_t * p_input,riffchunk_t *p_rifffather)
if ( __RIFF_SkipBytes( p_input,i_len + 8 ) != 0 ) if ( __RIFF_SkipBytes( p_input,i_len + 8 ) != 0 )
{ {
free( p_riff ); free( p_riff );
intf_ErrMsg( "input error: cannot go to the next chunk (ioriff)." );
return( -1 ); return( -1 );
} }
free( p_riff ); free( p_riff );
...@@ -205,7 +200,6 @@ static int RIFF_DescendChunk(input_thread_t * p_input) ...@@ -205,7 +200,6 @@ static int RIFF_DescendChunk(input_thread_t * p_input)
{ {
if ( __RIFF_SkipBytes(p_input,12) != 0) if ( __RIFF_SkipBytes(p_input,12) != 0)
{ {
intf_ErrMsg( "input error: cannot go into chunk." );
return ( -1 ); return ( -1 );
} }
return( 0 ); return( 0 );
...@@ -229,7 +223,6 @@ static int RIFF_AscendChunk(input_thread_t * p_input ,riffchunk_t *p_rifffather) ...@@ -229,7 +223,6 @@ static int RIFF_AscendChunk(input_thread_t * p_input ,riffchunk_t *p_rifffather)
if (( __RIFF_SkipBytes(p_input,i_skip)) != 0) if (( __RIFF_SkipBytes(p_input,i_skip)) != 0)
{ {
intf_ErrMsg( "ioriff: cannot exit from subchunk.");
return( -1 ); return( -1 );
} }
return( 0 ); return( 0 );
...@@ -280,7 +273,6 @@ static int RIFF_LoadChunkData(input_thread_t * p_input,riffchunk_t *p_riff ) ...@@ -280,7 +273,6 @@ static int RIFF_LoadChunkData(input_thread_t * p_input,riffchunk_t *p_riff )
RIFF_GoToChunkData(p_input); RIFF_GoToChunkData(p_input);
if ( input_SplitBuffer( p_input, &p_riff->p_data, p_riff->i_size ) != p_riff->i_size ) if ( input_SplitBuffer( p_input, &p_riff->p_data, p_riff->i_size ) != p_riff->i_size )
{ {
intf_ErrMsg( "ioriff: cannot read enough data " );
return ( -1 ); return ( -1 );
} }
if ( p_riff->i_size%2 != 0) if ( p_riff->i_size%2 != 0)
...@@ -388,7 +380,6 @@ static int RIFF_TestFileHeader( input_thread_t * p_input, riffchunk_t ** pp_ri ...@@ -388,7 +380,6 @@ static int RIFF_TestFileHeader( input_thread_t * p_input, riffchunk_t ** pp_ri
if( *pp_riff == NULL ) if( *pp_riff == NULL )
{ {
intf_ErrMsg( "input error: cannot retrieve header" );
return( -1 ); return( -1 );
} }
if( (*pp_riff)->i_id != FOURCC_RIFF ) if( (*pp_riff)->i_id != FOURCC_RIFF )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library * ffmpeg.c: video decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.3 2002/04/27 16:13:23 fenrir Exp $ * $Id: ffmpeg.c,v 1.4 2002/05/05 17:20:49 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -234,7 +234,8 @@ static void __PACKET_NEXT( videodec_thread_t *p_vdec ) ...@@ -234,7 +234,8 @@ static void __PACKET_NEXT( videodec_thread_t *p_vdec )
p_vdec->p_data->p_payload_start; p_vdec->p_data->p_payload_start;
} }
} while( p_vdec->i_data_size <= 0 ); } while( ( p_vdec->i_data_size <= 0 )
||( p_vdec->p_data->b_discard_payload ) );
} }
static void __PACKET_FILL( videodec_thread_t *p_vdec ) static void __PACKET_FILL( videodec_thread_t *p_vdec )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment