[FFmpeg-cvslog] lavc/mjpegenc: use proper error codes.

Nicolas George git at videolan.org
Tue Jan 7 21:35:33 CET 2014


ffmpeg | branch: release/2.1 | Nicolas George <george at nsup.org> | Sun Dec 29 10:54:32 2013 +0100| [3dae9d13e51c4b0a8b181e4f0a2b460e8465eeec] | committer: Michael Niedermayer

lavc/mjpegenc: use proper error codes.
(cherry picked from commit 2ebaadf35c9387610ca1eb7e94c171050562a77c)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3dae9d13e51c4b0a8b181e4f0a2b460e8465eeec
---

 libavcodec/mjpegenc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 8963289..eea4183 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -46,12 +46,12 @@ av_cold int ff_mjpeg_encode_init(MpegEncContext *s)
 
     if (s->width > 65500 || s->height > 65500) {
         av_log(s, AV_LOG_ERROR, "JPEG does not support resolutions above 65500x65500\n");
-        return -1;
+        return AVERROR(EINVAL);
     }
 
     m = av_malloc(sizeof(MJpegContext));
     if (!m)
-        return -1;
+        return AVERROR(ENOMEM);
 
     s->min_qcoeff=-1023;
     s->max_qcoeff= 1023;
@@ -503,7 +503,7 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
 
     //CODEC_FLAG_EMU_EDGE have to be cleared
     if(s->avctx->flags & CODEC_FLAG_EMU_EDGE)
-        return -1;
+        return AVERROR(EINVAL);
 
     pic = av_frame_alloc();
     if (!pic)



More information about the ffmpeg-cvslog mailing list