From f3298f12997eb4b7ad203766f768f92e3dd72a2a Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 23 Dec 2012 18:10:05 +0100 Subject: Return proper error code after av_log_ask_for_sample() --- libavcodec/anm.c | 2 +- libavcodec/cinepak.c | 2 +- libavcodec/h264.c | 2 +- libavcodec/pictordec.c | 2 +- libavcodec/ptx.c | 2 +- libavcodec/truemotion1.c | 2 +- libavcodec/truespeech.c | 2 +- libavcodec/wmalosslessdec.c | 2 +- libavcodec/wmaprodec.c | 6 +++--- 9 files changed, 11 insertions(+), 11 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/anm.c b/libavcodec/anm.c index fc328bb06b..d08ed8d140 100644 --- a/libavcodec/anm.c +++ b/libavcodec/anm.c @@ -158,7 +158,7 @@ static int decode_frame(AVCodecContext *avctx, break; // stop if (type == 2) { av_log_ask_for_sample(avctx, "unknown opcode"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } continue; } diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index c6f4ffa25c..9bf68634a9 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -334,7 +334,7 @@ static int cinepak_decode (CinepakContext *s) if (s->sega_film_skip_bytes == -1) { if (!encoded_buf_size) { av_log_ask_for_sample(s->avctx, "encoded_buf_size is 0"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } if (encoded_buf_size != s->size && (s->size % encoded_buf_size) != 0) { /* If the encoded frame size differs from the frame size as indicated diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 1a0b341641..fae8440a1e 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2873,7 +2873,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0) av_log_ask_for_sample(s->avctx, NULL); s->picture_structure = last_pic_structure; s->droppable = last_pic_droppable; - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } /* Take ownership of this buffer. Note that if another thread owned diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index e769537706..16f930730b 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -123,7 +123,7 @@ static int decode_frame(AVCodecContext *avctx, bpp = bits_per_plane * s->nb_planes; if (bits_per_plane > 8 || bpp < 1 || bpp > 32) { av_log_ask_for_sample(s, "unsupported bit depth\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } if (bytestream2_peek_byte(&s->g) == 0xFF) { diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index 77fd19615a..d4cd963e46 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -57,7 +57,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (bytes_per_pixel != 2) { av_log_ask_for_sample(avctx, "Image format is not RGB15.\n"); - return -1; + return AVERROR_PATCHWELCOME; } avctx->pix_fmt = AV_PIX_FMT_RGB555; diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index f6ca35c7b7..c49f9fecbf 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -356,7 +356,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s) if (s->flags & FLAG_SPRITE) { av_log_ask_for_sample(s->avctx, "SPRITE frame found.\n"); /* FIXME header.width, height, xoffset and yoffset aren't initialized */ - return -1; + return AVERROR_PATCHWELCOME; } else { s->w = header.xsize; s->h = header.ysize; diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c index 66e3427b78..486e41f895 100644 --- a/libavcodec/truespeech.c +++ b/libavcodec/truespeech.c @@ -65,7 +65,7 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx) if (avctx->channels != 1) { av_log_ask_for_sample(avctx, "Unsupported channel count: %d\n", avctx->channels); - return AVERROR(EINVAL); + return AVERROR_PATCHWELCOME; } avctx->channel_layout = AV_CH_LAYOUT_MONO; diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index a36c2c21c3..747ac37dc0 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -203,7 +203,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } else { av_log_ask_for_sample(avctx, "Unsupported extradata size\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } /* generic init */ diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index e19c3d36b9..d58278b76d 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -299,7 +299,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } else { av_log_ask_for_sample(avctx, "Unknown extradata size\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } /** generic init */ @@ -680,7 +680,7 @@ static int decode_channel_transform(WMAProDecodeCtx* s) if (get_bits1(&s->gb)) { av_log_ask_for_sample(s->avctx, "unsupported channel transform bit\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } for (s->num_chgroups = 0; remaining_channels && @@ -1150,7 +1150,7 @@ static int decode_subframe(WMAProDecodeCtx *s) /** no idea for what the following bit is used */ if (get_bits1(&s->gb)) { av_log_ask_for_sample(s->avctx, "reserved bit set\n"); - return AVERROR_INVALIDDATA; + return AVERROR_PATCHWELCOME; } -- cgit v1.2.3