diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-24 15:09:58 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-24 15:09:58 +0100 |
commit | d69238e991844cb0e9407c26e64dd7a551aa5bab (patch) | |
tree | a6169232d84d75370f66dcf011f8d7ee45594f8a /libavformat | |
parent | c6664242e0700ea0bc10109c7e84c3f9cf7fb9ae (diff) | |
parent | f3298f12997eb4b7ad203766f768f92e3dd72a2a (diff) | |
download | ffmpeg-d69238e991844cb0e9407c26e64dd7a551aa5bab.tar.gz |
Merge commit 'f3298f12997eb4b7ad203766f768f92e3dd72a2a'
* commit 'f3298f12997eb4b7ad203766f768f92e3dd72a2a':
Return proper error code after av_log_ask_for_sample()
configure: cosmetics: Separate hwaccel dependencies from decoders/encoders
oggdec: check memory allocation
Conflicts:
configure
libavcodec/pictordec.c
libavformat/anm.c
libavformat/oggdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/anm.c | 4 | ||||
-rw-r--r-- | libavformat/au.c | 2 | ||||
-rw-r--r-- | libavformat/filmstripdec.c | 2 | ||||
-rw-r--r-- | libavformat/mtv.c | 2 | ||||
-rw-r--r-- | libavformat/oggdec.c | 6 | ||||
-rw-r--r-- | libavformat/rsodec.c | 2 | ||||
-rw-r--r-- | libavformat/smjpegdec.c | 2 | ||||
-rw-r--r-- | libavformat/spdifenc.c | 2 |
8 files changed, 12 insertions, 10 deletions
diff --git a/libavformat/anm.c b/libavformat/anm.c index 69a5ddab0f..f93c57e08a 100644 --- a/libavformat/anm.c +++ b/libavformat/anm.c @@ -86,7 +86,7 @@ static int read_header(AVFormatContext *s) avio_skip(pb, 4); /* magic number */ if (avio_rl16(pb) != MAX_PAGES) { av_log_ask_for_sample(s, "max_pages != " AV_STRINGIFY(MAX_PAGES) "\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } anm->nb_pages = avio_rl16(pb); @@ -163,7 +163,7 @@ static int read_header(AVFormatContext *s) invalid: av_log_ask_for_sample(s, NULL); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } static int read_packet(AVFormatContext *s, diff --git a/libavformat/au.c b/libavformat/au.c index 55a32388ab..3648e89df3 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -93,7 +93,7 @@ static int au_read_header(AVFormatContext *s) if (!(bps = av_get_bits_per_sample(codec))) { av_log_ask_for_sample(s, "could not determine bits per sample\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } if (channels == 0 || channels > 64) { diff --git a/libavformat/filmstripdec.c b/libavformat/filmstripdec.c index b41fdb73e5..aa41fa45c5 100644 --- a/libavformat/filmstripdec.c +++ b/libavformat/filmstripdec.c @@ -56,7 +56,7 @@ static int read_header(AVFormatContext *s) st->nb_frames = avio_rb32(pb); if (avio_rb16(pb) != 0) { av_log_ask_for_sample(s, "unsupported packing method\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } avio_skip(pb, 2); diff --git a/libavformat/mtv.c b/libavformat/mtv.c index 622a9b8f5e..5f39ec5368 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -115,7 +115,7 @@ static int mtv_read_header(AVFormatContext *s) if (audio_subsegments == 0) { av_log_ask_for_sample(s, "MTV files without audio are not supported\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } mtv->full_segment_size = diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index acc2a6df6c..794a7754db 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -220,8 +220,8 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial) if (av_size_mult(ogg->nstreams + 1, sizeof(*ogg->streams), &size) < 0 || !(os = av_realloc(ogg->streams, size))) return AVERROR(ENOMEM); - ogg->streams = os; - os = ogg->streams + idx; + ogg->streams = os; + os = ogg->streams + idx; memset(os, 0, sizeof(*os)); os->serial = serial; os->bufsize = DECODER_BUFFER_SIZE; @@ -374,6 +374,8 @@ static int ogg_read_page(AVFormatContext *s, int *sid) if (os->bufsize - os->bufpos < size) { uint8_t *nb = av_malloc((os->bufsize *= 2) + FF_INPUT_BUFFER_PADDING_SIZE); + if (!nb) + return AVERROR(ENOMEM); memcpy(nb, os->buf, os->bufpos); av_free(os->buf); os->buf = nb; diff --git a/libavformat/rsodec.c b/libavformat/rsodec.c index d8ed695fdf..aae80a8221 100644 --- a/libavformat/rsodec.c +++ b/libavformat/rsodec.c @@ -50,7 +50,7 @@ static int rso_read_header(AVFormatContext *s) bps = av_get_bits_per_sample(codec); if (!bps) { av_log_ask_for_sample(s, "could not determine bits per sample\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } /* now we are ready: build format streams */ diff --git a/libavformat/smjpegdec.c b/libavformat/smjpegdec.c index ceb29c9b5f..f32f635d5f 100644 --- a/libavformat/smjpegdec.c +++ b/libavformat/smjpegdec.c @@ -78,7 +78,7 @@ static int smjpeg_read_header(AVFormatContext *s) case SMJPEG_SND: if (ast) { av_log_ask_for_sample(s, "multiple audio streams not supported\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } hlength = avio_rb32(pb); if (hlength < 8) diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c index cd9a7d4052..aaf0568763 100644 --- a/libavformat/spdifenc.c +++ b/libavformat/spdifenc.c @@ -414,7 +414,7 @@ static int spdif_header_truehd(AVFormatContext *s, AVPacket *pkt) * distribute the TrueHD frames in the MAT frame */ av_log(s, AV_LOG_ERROR, "TrueHD frame too big, %d bytes\n", pkt->size); av_log_ask_for_sample(s, NULL); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } memcpy(&ctx->hd_buf[ctx->hd_buf_count * TRUEHD_FRAME_OFFSET - BURST_HEADER_SIZE + mat_code_length], |