[FFmpeg-cvslog] indeo: use proper error code
Luca Barbato
git at videolan.org
Mon Jul 29 04:40:46 CEST 2013
ffmpeg | branch: release/0.10 | Luca Barbato <lu_zero at gentoo.org> | Sun Jun 30 10:11:05 2013 +0200| [7eff48029f997c82023e20eb90272bb901ff9204] | committer: Reinhard Tartler
indeo: use proper error code
(cherry picked from commit dd3754a48854cd570d38db72394491aab0f36570)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
Conflicts:
libavcodec/ivi_common.c
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7eff48029f997c82023e20eb90272bb901ff9204
---
libavcodec/ivi_common.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index ed9c283..c0d8f36 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -74,7 +74,7 @@ int ff_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])
@@ -433,7 +433,7 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
} else {
if (sym >= 256U) {
av_log(NULL, AV_LOG_ERROR, "Invalid sym encountered: %d.\n", sym);
- return -1;
+ return AVERROR_INVALIDDATA;
}
run = rvmap->runtab[sym];
val = rvmap->valtab[sym];
@@ -456,7 +456,7 @@ int ff_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) {
@@ -794,14 +794,14 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
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;
+ return AVERROR_PATCHWELCOME;
}
ctx->switch_buffers(ctx);
@@ -812,10 +812,10 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
for (p = 0; p < 3; p++) {
for (b = 0; b < ctx->planes[p].num_bands; b++) {
result = decode_band(ctx, p, &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;
}
}
}
More information about the ffmpeg-cvslog
mailing list