diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-10 20:51:32 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-10 20:52:14 +0100 |
commit | c3bb3334f6837025fb23d5bcd29ba094aa368c6b (patch) | |
tree | 6ba7b2017cfd6695977d74b67e3f9eec4509d2bf | |
parent | c73685398dee3290dd9f67013f1cd310b7f9fb33 (diff) | |
download | ffmpeg-c3bb3334f6837025fb23d5bcd29ba094aa368c6b.tar.gz |
h264: dont try to allocate scratchpad if linesize is not known
Fixes out of array access
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 6becfcb05d..86489ee4b5 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1228,7 +1228,7 @@ static int decode_update_thread_context(AVCodecContext *dst, /* frame_start may not be called for the next thread (if it's decoding * a bottom field) so this has to be allocated here */ - if (!h->bipred_scratchpad) + if (!h->bipred_scratchpad && s->linesize) h->bipred_scratchpad = av_malloc(16 * 6 * s->linesize); // extradata/NAL handling |