diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-14 14:36:17 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-14 14:43:32 +0100 |
commit | 329675cfd71fab29e47ea9c64f3560f0305dbf36 (patch) | |
tree | 45b4e04ad5d38aa6bbb14cb9d75729d40db2abfd /libavcodec/msrle.c | |
parent | a646ac8ef5c51d6a47eb564d58d04564c0489871 (diff) | |
parent | a1c525f7eb0783d31ba7a653865b6cbd3dc880de (diff) | |
download | ffmpeg-329675cfd71fab29e47ea9c64f3560f0305dbf36.tar.gz |
Merge commit 'a1c525f7eb0783d31ba7a653865b6cbd3dc880de'
* commit 'a1c525f7eb0783d31ba7a653865b6cbd3dc880de':
pcx: return meaningful error codes.
tmv: return meaningful error codes.
msrle: return meaningful error codes.
cscd: return meaningful error codes.
yadif: x86: fix build for compilers without aligned stack
lavc: introduce the convenience function init_get_bits8
lavc: check for overflow in init_get_bits
Conflicts:
libavcodec/cscd.c
libavcodec/pcx.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/msrle.c')
-rw-r--r-- | libavcodec/msrle.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 5b7ba7fdad..5c1fb5c32a 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -67,7 +67,7 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx) break; default: av_log(avctx, AV_LOG_ERROR, "unsupported bits per sample\n"); - return -1; + return AVERROR_INVALIDDATA; } avcodec_get_frame_defaults(&s->frame); @@ -88,15 +88,16 @@ static int msrle_decode_frame(AVCodecContext *avctx, int buf_size = avpkt->size; MsrleContext *s = avctx->priv_data; int istride = FFALIGN(avctx->width*avctx->bits_per_coded_sample, 32) / 8; + int ret; s->buf = buf; s->size = buf_size; s->frame.reference = 3; s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; - if (avctx->reget_buffer(avctx, &s->frame)) { + if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); - return -1; + return ret; } if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) { |