[FFmpeg-cvslog] r25455 - trunk/libavcodec/targaenc.c

stefano subversion
Tue Oct 12 20:44:28 CEST 2010


Author: stefano
Date: Tue Oct 12 20:44:28 2010
New Revision: 25455

Log:
Make the targa encoder return sane error values rather than -1.

Modified:
   trunk/libavcodec/targaenc.c

Modified: trunk/libavcodec/targaenc.c
==============================================================================
--- trunk/libavcodec/targaenc.c	Tue Oct 12 20:44:25 2010	(r25454)
+++ trunk/libavcodec/targaenc.c	Tue Oct 12 20:44:28 2010	(r25455)
@@ -81,12 +81,12 @@ static int targa_encode_frame(AVCodecCon
 
     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(AVCodecCon
     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;
 



More information about the ffmpeg-cvslog mailing list