aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rawdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-30 04:35:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-10-30 13:18:57 +0100
commit60e957476e338a200501e0bdad40b7bf0076b268 (patch)
tree9293a71119593af7b180df40b379f387dd451590 /libavcodec/rawdec.c
parentd3de3a16d1e428139c1541e55ea483466c1380e7 (diff)
downloadandroid_external_ffmpeg-60e957476e338a200501e0bdad40b7bf0076b268.tar.gz
android_external_ffmpeg-60e957476e338a200501e0bdad40b7bf0076b268.tar.bz2
android_external_ffmpeg-60e957476e338a200501e0bdad40b7bf0076b268.zip
rawdec: check avpicture_get_size() return value
Fixes CID205019 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r--libavcodec/rawdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index eb96deb6ae..4d4bce91f2 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -113,11 +113,15 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
avctx->pix_fmt==AV_PIX_FMT_PAL8 &&
(!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))){
context->length = avpicture_get_size(avctx->pix_fmt, FFALIGN(avctx->width, 16), avctx->height);
+ if (context->length < 0)
+ return context->length;
context->buffer = av_malloc(context->length);
if (!context->buffer)
return AVERROR(ENOMEM);
} else {
context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
+ if (context->length < 0)
+ return context->length;
}
context->pic.pict_type = AV_PICTURE_TYPE_I;
context->pic.key_frame = 1;