avcodec/ljpegenc: fix mem allocation failure return code encode_picture_lossless()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 6 Dec 2013 10:49:17 +0000 (11:49 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 6 Dec 2013 10:49:17 +0000 (11:49 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ljpegenc.c

index 9316b11..7e536a8 100644 (file)
@@ -63,7 +63,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
         s->rd_scratchpad = av_mallocz(alloc_size * 4 * 16 * 2);
         if (!s->rd_scratchpad) {
             av_log(avctx, AV_LOG_ERROR, "failed to allocate context scratch buffers.\n");
-            return ret;
+            return AVERROR(ENOMEM);
         }
     }