@ -42,8 +42,8 @@
typedef struct APEFrame {
typedef struct APEFrame {
int64_t pos ;
int64_t pos ;
int64_t size ;
int nblocks ;
int nblocks ;
int size ;
int skip ;
int skip ;
int64_t pts ;
int64_t pts ;
} APEFrame ;
} APEFrame ;
@ -128,7 +128,7 @@ static void ape_dumpinfo(AVFormatContext * s, APEContext * ape_ctx)
av_log ( s , AV_LOG_DEBUG , " \n Frames \n \n " ) ;
av_log ( s , AV_LOG_DEBUG , " \n Frames \n \n " ) ;
for ( i = 0 ; i < ape_ctx - > totalframes ; i + + )
for ( i = 0 ; i < ape_ctx - > totalframes ; i + + )
av_log ( s , AV_LOG_DEBUG , " %8d %8 " PRId64 " %8d (%d samples) \n " , i ,
av_log ( s , AV_LOG_DEBUG , " %8d %8 " PRId64 " %8 " PRI d64 " (%d samples) \n " , i ,
ape_ctx - > frames [ i ] . pos , ape_ctx - > frames [ i ] . size ,
ape_ctx - > frames [ i ] . pos , ape_ctx - > frames [ i ] . size ,
ape_ctx - > frames [ i ] . nblocks ) ;
ape_ctx - > frames [ i ] . nblocks ) ;
@ -146,7 +146,8 @@ static int ape_read_header(AVFormatContext * s)
AVStream * st ;
AVStream * st ;
uint32_t tag ;
uint32_t tag ;
int i , ret ;
int i , ret ;
int total_blocks , final_size = 0 ;
int total_blocks ;
int64_t final_size = 0 ;
int64_t pts , file_size ;
int64_t pts , file_size ;
/* Skip any leading junk such as id3v2 tags */
/* Skip any leading junk such as id3v2 tags */
@ -387,7 +388,7 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
if ( ape - > frames [ ape - > currentframe ] . size < = 0 | |
if ( ape - > frames [ ape - > currentframe ] . size < = 0 | |
ape - > frames [ ape - > currentframe ] . size > INT_MAX - extra_size ) {
ape - > frames [ ape - > currentframe ] . size > INT_MAX - extra_size ) {
av_log ( s , AV_LOG_ERROR , " invalid packet size: %d \n " ,
av_log ( s , AV_LOG_ERROR , " invalid packet size: %8 " PRI d64 " \n " ,
ape - > frames [ ape - > currentframe ] . size ) ;
ape - > frames [ ape - > currentframe ] . size ) ;
ape - > currentframe + + ;
ape - > currentframe + + ;
return AVERROR ( EIO ) ;
return AVERROR ( EIO ) ;