diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-01 21:42:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 21:36:15 +0200 |
commit | 6b14563c0e7848992a5fe70a80135fe090bfad51 (patch) | |
tree | 34edb39cf7a5c348338d4f10b37fd5619a32fe48 | |
parent | 3074e8f78c4d84f93c1bdc05f36f0bce8b8a830f (diff) | |
download | ffmpeg-6b14563c0e7848992a5fe70a80135fe090bfad51.tar.gz |
wmv1: check that the input buffer is large enough
Fixes null ptr deref
Fixes Ticket1367
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f23a2418fb0ccc56fdae4dbf83a5994cc917c475)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/wnv1.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 56634d10ac..27026c5bd7 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -70,6 +70,11 @@ static int decode_frame(AVCodecContext *avctx, int prev_y = 0, prev_u = 0, prev_v = 0; uint8_t *rbuf; + if(buf_size<=8) { + av_log(avctx, AV_LOG_ERROR, "buf_size %d is too small\n", buf_size); + return AVERROR_INVALIDDATA; + } + rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE); if(!rbuf){ av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n"); |