aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mjpegenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-30 13:29:47 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-30 13:29:51 +0100
commit905bac2cd30d445cd84779068cb168a578511912 (patch)
tree0caa82ec70f5600fd3c630ffbefeee7468057e67 /libavcodec/mjpegenc.c
parent3cc0f335fe14d05f6f403b09586545f73cc16bc6 (diff)
parent2ebaadf35c9387610ca1eb7e94c171050562a77c (diff)
downloadffmpeg-905bac2cd30d445cd84779068cb168a578511912.tar.gz
Merge remote-tracking branch 'cigaes/master'
* cigaes/master: lavc/mjpegenc: use proper error codes. lavc/mjpegenc: check av_frame_alloc() failure. lavc/libopenjpegenc: check av_frame_alloc() failure. lavc/diracdec: check av_frame_alloc() failure. lavc/utils: check av_frame_alloc() failure. ffprobe: check av_frame_alloc() failure. lavc/ffwavesynth: fix dependency sizeof(AVFrame). Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mjpegenc.c')
-rw-r--r--libavcodec/mjpegenc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index f23343af84..518a7d56a4 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -48,12 +48,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;
@@ -545,9 +545,11 @@ 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)
+ return AVERROR(ENOMEM);
av_frame_ref(pic, pic_arg);
//picture should be flipped upside-down
for(i=0; i < 3; i++) {