diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-26 18:56:39 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-28 18:53:12 +0100 |
commit | 6212758c075775a9f3e5eedfa09613a1ec984424 (patch) | |
tree | dba048ae9495c27ad6823f28ada9189e37df267a /libavcodec | |
parent | ef8fbb4878dc8059f17b9ba4ab882bcc706a58c3 (diff) | |
download | ffmpeg-6212758c075775a9f3e5eedfa09613a1ec984424.tar.gz |
avcodec/rawdec: Check the return code of avpicture_get_size()
Fixes out of array access
Fixes: asan_heap-oob_22388d0_3435_cov_3297128910_small_roll5_FlashCine1.cine
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1d3a3b9f8907625b361420d48fe05716859620ff)
Conflicts:
libavcodec/rawdec.c
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/rawdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index dd47f532fd..5e98e24b32 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -144,6 +144,9 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) context->frame_size = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); } + if (context->frame_size < 0) + return context->frame_size; + if ((avctx->extradata_size >= 9 && !memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9)) || |