diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 1ac9a408dc2acc6184553bd13c2967abede7c429..4d2981780cd10575c5f35981145c2bbd49d652ae 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -422,7 +422,7 @@ static int avi_write_header(AVFormatContext *s) put_le32(pb, 0); break; default: - av_abort(); + return -1; } end_tag(pb, strh); @@ -438,7 +438,7 @@ static int avi_write_header(AVFormatContext *s) } break; default: - av_abort(); + return -1; } end_tag(pb, strf); diff --git a/libavformat/ffm.c b/libavformat/ffm.c index 22a2a812ff9bfdac556642981ccca738fb9c3086..89764c349737984019d234e26d92dd0eddd2fdd3 100644 --- a/libavformat/ffm.c +++ b/libavformat/ffm.c @@ -190,7 +190,7 @@ static int ffm_write_header(AVFormatContext *s) put_le16(pb, codec->frame_size); break; default: - av_abort(); + return -1; } /* hack to have real time */ if (ffm_nopts) @@ -208,8 +208,7 @@ static int ffm_write_header(AVFormatContext *s) /* init packet mux */ ffm->packet_ptr = ffm->packet; ffm->packet_end = ffm->packet + ffm->packet_size - FFM_HEADER_SIZE; - if (ffm->packet_end < ffm->packet) - av_abort(); + assert(ffm->packet_end >= ffm->packet); ffm->frame_offset = 0; ffm->pts = 0; ffm->first_packet = 1; @@ -340,7 +339,7 @@ static int ffm_read_data(AVFormatContext *s, get_buffer(pb, ffm->packet, ffm->packet_size - FFM_HEADER_SIZE); ffm->packet_end = ffm->packet + (ffm->packet_size - FFM_HEADER_SIZE - fill_size); if (ffm->packet_end < ffm->packet) - av_abort(); + return -1; /* if first packet or resynchronization packet, we must handle it specifically */ if (ffm->first_packet || (frame_offset & 0x8000)) { @@ -355,7 +354,7 @@ static int ffm_read_data(AVFormatContext *s, } ffm->first_packet = 0; if ((frame_offset & 0x7ffff) < FFM_HEADER_SIZE) - av_abort(); + return -1; ffm->packet_ptr = ffm->packet + (frame_offset & 0x7fff) - FFM_HEADER_SIZE; if (!first) break; diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index adf871a6699fb64ad12300d17751c5bb192fac32..cf6cb0b3756e466ba74010a21162f090490ba2be 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -314,7 +314,7 @@ static int mpeg_mux_init(AVFormatContext *ctx) s->video_bound++; break; default: - av_abort(); + return -1; } } /* if no SCR, use first stream (audio) */ diff --git a/libavformat/raw.c b/libavformat/raw.c index 9c1bd929c90687ea14e546fcfc42bd31e3d1e26f..dadc4957665390c3fdf9f1913c3bd0501c332243 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -557,7 +557,7 @@ static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt) packet_size = avpicture_get_size(st->codec.pix_fmt, width, height); if (packet_size < 0) - av_abort(); + return -1; if (av_new_packet(pkt, packet_size) < 0) return AVERROR_IO; diff --git a/libavformat/rm.c b/libavformat/rm.c index de16a3033cd17ab15ce78193b7b1cf94a9772906..59888e2cdf47186d2ef436aed34ac299f3283d8d 100644 --- a/libavformat/rm.c +++ b/libavformat/rm.c @@ -315,7 +315,7 @@ static int rm_write_header(AVFormatContext *s) stream->total_frames = stream->nb_packets; break; default: - av_abort(); + return -1; } } diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index 182536c4f736072ada52de00e27d5e9885afd3a5..6ebe185b64349142dca83a31ebdbf9f7841fbd93 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -214,7 +214,7 @@ static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt) packet_size = avpicture_get_size(st->codec.pix_fmt, width, height); if (packet_size < 0) - av_abort(); + return -1; if (av_new_packet(pkt, packet_size) < 0) return AVERROR_IO;