aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/targaenc.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-10-12 18:44:28 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-10-12 18:44:28 +0000
commite259eadcabe188988c0a9696707791f3497738c2 (patch)
treee7e3b00c7ca40555e5769db4b83900b349214dd8 /libavcodec/targaenc.c
parent7c559bc77ea0ebb5630027032b452562eb82048c (diff)
downloadffmpeg-e259eadcabe188988c0a9696707791f3497738c2.tar.gz
Make the targa encoder return sane error values rather than -1.
Originally committed as revision 25455 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/targaenc.c')
-rw-r--r--libavcodec/targaenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c
index 325df46a9f..1db0ea2155 100644
--- a/libavcodec/targaenc.c
+++ b/libavcodec/targaenc.c
@@ -81,12 +81,12 @@ static int targa_encode_frame(AVCodecContext *avctx,
if(avctx->width > 0xffff || avctx->height > 0xffff) {
av_log(avctx, AV_LOG_ERROR, "image dimensions too large\n");
- return -1;
+ return AVERROR(EINVAL);
}
picsize = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
if(buf_size < picsize + 45) {
av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
+ return AVERROR(EINVAL);
}
p->pict_type= FF_I_TYPE;
@@ -115,7 +115,7 @@ static int targa_encode_frame(AVCodecContext *avctx,
default:
av_log(avctx, AV_LOG_ERROR, "Pixel format '%s' not supported.\n",
avcodec_get_pix_fmt_name(avctx->pix_fmt));
- return -1;
+ return AVERROR(EINVAL);
}
bpp = outbuf[16] >> 3;