diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-01 11:37:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-01 11:37:37 +0200 |
commit | 280afa40bcf52f3ce419c3ec3c33d13f0f40e48a (patch) | |
tree | 2af3b63997236faa6b413c2bb039f261393c5e54 | |
parent | 43229d609a1796cce3537932539439529b134b9b (diff) | |
parent | dd3754a48854cd570d38db72394491aab0f36570 (diff) | |
download | ffmpeg-280afa40bcf52f3ce419c3ec3c33d13f0f40e48a.tar.gz |
Merge commit 'dd3754a48854cd570d38db72394491aab0f36570'
* commit 'dd3754a48854cd570d38db72394491aab0f36570':
indeo: use proper error code
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/ivi_common.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index 0be9baae40..0084e1af9c 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -85,7 +85,7 @@ static int ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag) bits[pos] = i + cb->xbits[i] + not_last_row; if (bits[pos] > IVI_VLC_BITS) - return -1; /* invalid descriptor */ + return AVERROR_INVALIDDATA; /* invalid descriptor */ codewords[pos] = inv_bits((prefix | j), bits[pos]); if (!bits[pos]) @@ -493,7 +493,7 @@ static int ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile } else { if (sym >= 256U) { av_log(avctx, AV_LOG_ERROR, "Invalid sym encountered: %d.\n", sym); - return -1; + return AVERROR_INVALIDDATA; } run = rvmap->runtab[sym]; val = rvmap->valtab[sym]; @@ -516,7 +516,7 @@ static int ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile }// while if (scan_pos >= num_coeffs && sym != rvmap->eob_sym) - return -1; /* corrupt block data */ + return AVERROR_INVALIDDATA; /* corrupt block data */ /* undoing DC coeff prediction for intra-blocks */ if (is_intra && band->is_2d_trans) { @@ -870,14 +870,14 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (result) { av_log(avctx, AV_LOG_ERROR, "Error while decoding picture header: %d\n", result); - return -1; + return result; } if (ctx->gop_invalid) return AVERROR_INVALIDDATA; if (ctx->gop_flags & IVI5_IS_PROTECTED) { - av_log(avctx, AV_LOG_ERROR, "Password-protected clip!\n"); - return -1; + avpriv_report_missing_feature(avctx, "Password-protected clip!\n"); + return AVERROR_PATCHWELCOME; } ctx->switch_buffers(ctx); @@ -889,10 +889,10 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, for (p = 0; p < 3; p++) { for (b = 0; b < ctx->planes[p].num_bands; b++) { result = decode_band(ctx, &ctx->planes[p].bands[b], avctx); - if (result) { + if (result < 0) { av_log(avctx, AV_LOG_ERROR, "Error while decoding band: %d, plane: %d\n", b, p); - return -1; + return result; } } } |