1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

replace wrong return 0 by -1

Originally committed as revision 7654 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2007-01-22 21:28:56 +00:00
parent 13f7e4b966
commit ceba96cb26

View File

@ -502,11 +502,11 @@ static int asf_get_packet(AVFormatContext *s)
//the following checks prevent overflows and infinite loops //the following checks prevent overflows and infinite loops
if(packet_length >= (1U<<29)){ if(packet_length >= (1U<<29)){
av_log(s, AV_LOG_ERROR, "invalid packet_length %d at:%"PRId64"\n", packet_length, url_ftell(pb)); av_log(s, AV_LOG_ERROR, "invalid packet_length %d at:%"PRId64"\n", packet_length, url_ftell(pb));
return 0; // FIXME this should be -1 return -1;
} }
if(padsize >= (1U<<29)){ if(padsize >= (1U<<29)){
av_log(s, AV_LOG_ERROR, "invalid padsize %d at:%"PRId64"\n", padsize, url_ftell(pb)); av_log(s, AV_LOG_ERROR, "invalid padsize %d at:%"PRId64"\n", padsize, url_ftell(pb));
return 0; // FIXME this should be -1 return -1;
} }
asf->packet_timestamp = get_le32(pb); asf->packet_timestamp = get_le32(pb);
@ -598,6 +598,8 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
//static int pc = 0; //static int pc = 0;
for (;;) { for (;;) {
if(url_feof(pb))
return AVERROR_IO;
if (asf->packet_size_left < FRAME_HEADER_SIZE if (asf->packet_size_left < FRAME_HEADER_SIZE
|| asf->packet_segments < 1) { || asf->packet_segments < 1) {
//asf->packet_size_left <= asf->packet_padsize) { //asf->packet_size_left <= asf->packet_padsize) {
@ -619,8 +621,8 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR_IO; /* Do not exceed the size of the data object */ return AVERROR_IO; /* Do not exceed the size of the data object */
ret = asf_get_packet(s); ret = asf_get_packet(s);
//printf("READ ASF PACKET %d r:%d c:%d\n", ret, asf->packet_size_left, pc++); //printf("READ ASF PACKET %d r:%d c:%d\n", ret, asf->packet_size_left, pc++);
if (ret < 0 || url_feof(pb)) if (ret < 0)
return AVERROR_IO; assert(asf->packet_size_left < FRAME_HEADER_SIZE || asf->packet_segments < 1);
asf->packet_time_start = 0; asf->packet_time_start = 0;
continue; continue;
} }