diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-05 02:16:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-05 02:17:01 +0100 |
commit | dcf7924f4df642eba3101e1e13a40768bf24ebf7 (patch) | |
tree | 9da61abc55a6ff6f6738fbf415b99a310b8f32c2 /libavcodec/pcxenc.c | |
parent | 4574f11e4dd3e8cfd102c8c675e4de40f7532ce6 (diff) | |
parent | f3b74d944bdef9bbe81f7690f8d837d843ec13a6 (diff) | |
download | ffmpeg-dcf7924f4df642eba3101e1e13a40768bf24ebf7.tar.gz |
Merge commit 'f3b74d944bdef9bbe81f7690f8d837d843ec13a6'
* commit 'f3b74d944bdef9bbe81f7690f8d837d843ec13a6':
pcxenc: Return more meaningful error codes
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pcxenc.c')
-rw-r--r-- | libavcodec/pcxenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/pcxenc.c b/libavcodec/pcxenc.c index f48063b9b2..a718428d7a 100644 --- a/libavcodec/pcxenc.c +++ b/libavcodec/pcxenc.c @@ -69,7 +69,7 @@ static int pcx_rle_encode( uint8_t *dst, int dst_size, // check worst-case upper bound on dst_size if (dst_size < 2LL * src_plane_size * nplanes || src_plane_size <= 0) - return -1; + return AVERROR(EINVAL); for (p = 0; p < nplanes; p++) { int count = 1; @@ -114,7 +114,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, if (avctx->width > 65535 || avctx->height > 65535) { av_log(avctx, AV_LOG_ERROR, "image dimensions do not fit in 16 bits\n"); - return -1; + return AVERROR(EINVAL); } switch (avctx->pix_fmt) { @@ -144,7 +144,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, break; default: av_log(avctx, AV_LOG_ERROR, "unsupported pixfmt\n"); - return -1; + return AVERROR(EINVAL); } line_bytes = (avctx->width * bpp + 7) >> 3; @@ -186,7 +186,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, if ((written = pcx_rle_encode(buf, buf_end - buf, src, line_bytes, nplanes)) < 0) { av_log(avctx, AV_LOG_ERROR, "buffer too small\n"); - return -1; + return AVERROR_BUG; } buf += written; src += frame->linesize[0]; @@ -195,7 +195,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, if (nplanes == 1 && bpp == 8) { if (buf_end - buf < 257) { av_log(avctx, AV_LOG_ERROR, "buffer too small\n"); - return -1; + return AVERROR_BUG; } bytestream_put_byte(&buf, 12); for (i = 0; i < 256; i++) { |