Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-30 02:10:03 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-11-30 02:12:42 +0400
commit0b28abf903cd1fd61ba4a06009cd2cb7cc40e6e0 (patch)
treed82e98e4888b24bf3dda5f9a45a1994bd7b4577f /libavcodec/vble.c
parent10416a4d56fa8a89784e4fb62099c3cab17a9952 (diff)
vble: check packet size.
Fixes null pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vble.c')
-rw-r--r--libavcodec/vble.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/vble.c b/libavcodec/vble.c
index 448006a0c3..2c681782bd 100644
--- a/libavcodec/vble.c
+++ b/libavcodec/vble.c
@@ -127,6 +127,11 @@ static int vble_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
if (pic->data[0])
avctx->release_buffer(avctx, pic);
+ if (avpkt->size < 4 || avpkt->size - 4 > INT_MAX/8) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid packet size\n");
+ return AVERROR_INVALIDDATA;
+ }
+
/* Allocate buffer */
if (avctx->get_buffer(avctx, pic) < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");