lclenc: allocate FF_INPUT_BUFFER_PADDING_SIZE for extradata
authorPaul B Mahol <onemda@gmail.com>
Fri, 26 Jul 2013 21:50:28 +0000 (21:50 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sat, 27 Jul 2013 12:02:18 +0000 (12:02 +0000)
Also check return value.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/lclenc.c

index cbfd8fe..263e66b 100644 (file)
@@ -137,7 +137,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
 
     av_assert0(avctx->width && avctx->height);
 
-    avctx->extradata= av_mallocz(8);
+    avctx->extradata = av_mallocz(8 + FF_INPUT_BUFFER_PADDING_SIZE);
+    if (!avctx->extradata)
+        return AVERROR(ENOMEM);
     avctx->coded_frame= &c->pic;
 
     c->compression = avctx->compression_level == FF_COMPRESSION_DEFAULT ?