diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-21 14:54:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-21 14:55:21 +0200 |
commit | 99ea47fe5a554126c2ddaccac42979e49d891aa4 (patch) | |
tree | 19c39873be00641e8b9575c09981fdcf59d580d8 /libavcodec/ffv1enc.c | |
parent | 69fd0b7adbd22f24d45b6edb10eaf37d18c66bee (diff) | |
parent | 4a2a4524a3f50ed302820ba971ddd48e78c7436f (diff) | |
download | ffmpeg-99ea47fe5a554126c2ddaccac42979e49d891aa4.tar.gz |
Merge commit '4a2a4524a3f50ed302820ba971ddd48e78c7436f'
* commit '4a2a4524a3f50ed302820ba971ddd48e78c7436f':
ffv1: propagate errors
Conflicts:
libavcodec/ffv1dec.c
libavcodec/ffv1enc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ffv1enc.c')
-rw-r--r-- | libavcodec/ffv1enc.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index be0d78285e..819d081acc 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -277,12 +277,12 @@ static av_always_inline int encode_line(FFV1Context *s, int w, if (s->ac) { if (c->bytestream_end - c->bytestream < w * 20) { av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); - return -1; + return AVERROR_INVALIDDATA; } } else { if (s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb) >> 3) < w * 4) { av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); - return -1; + return AVERROR_INVALIDDATA; } } @@ -633,7 +633,7 @@ static av_cold int encode_init(AVCodecContext *avctx) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); FFV1Context *s = avctx->priv_data; - int i, j, k, m; + int i, j, k, m, ret; ffv1_common_init(avctx); @@ -689,7 +689,7 @@ static av_cold int encode_init(AVCodecContext *avctx) } if (!s->ac) { av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample of more than 8 needs -coder 1 currently\n"); - return AVERROR_INVALIDDATA; + return AVERROR(ENOSYS); } s->version = FFMAX(s->version, 1); case AV_PIX_FMT_GRAY8: @@ -736,7 +736,7 @@ static av_cold int encode_init(AVCodecContext *avctx) break; default: av_log(avctx, AV_LOG_ERROR, "format not supported\n"); - return AVERROR_INVALIDDATA; + return AVERROR(ENOSYS); } if (s->transparency) { av_log(avctx, AV_LOG_WARNING, "Storing alpha plane, this will require a recent FFV1 decoder to playback!\n"); @@ -817,7 +817,7 @@ static av_cold int encode_init(AVCodecContext *avctx) if (next == p) { av_log(avctx, AV_LOG_ERROR, "2Pass file invalid at %d %d [%s]\n", j, i, p); - return -1; + return AVERROR_INVALIDDATA; } p = next; } @@ -879,10 +879,10 @@ static av_cold int encode_init(AVCodecContext *avctx) write_extra_header(s); } - if (ffv1_init_slice_contexts(s) < 0) - return -1; - if (ffv1_init_slices_state(s) < 0) - return -1; + if ((ret = ffv1_init_slice_contexts(s)) < 0) + return ret; + if ((ret = ffv1_init_slices_state(s)) < 0) + return ret; #define STATS_OUT_SIZE 1024 * 1024 * 6 if (avctx->flags & CODEC_FLAG_PASS1) { |