aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/wnv1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-01 21:42:29 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-01 23:22:54 +0200
commitf23a2418fb0ccc56fdae4dbf83a5994cc917c475 (patch)
treed9b9649f1d67b2c2fa737cdf92c43fa970c87a78 /libavcodec/wnv1.c
parentfd0c83c6667de5b1ebe40f115a746fddea558168 (diff)
downloadandroid_external_ffmpeg-f23a2418fb0ccc56fdae4dbf83a5994cc917c475.tar.gz
android_external_ffmpeg-f23a2418fb0ccc56fdae4dbf83a5994cc917c475.tar.bz2
android_external_ffmpeg-f23a2418fb0ccc56fdae4dbf83a5994cc917c475.zip
wmv1: check that the input buffer is large enough
Fixes null ptr deref Fixes Ticket1367 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wnv1.c')
-rw-r--r--libavcodec/wnv1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c
index 21ff361f1e..62e9b992a4 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");