aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-09-21 11:42:55 -0400
committerMichael Niedermayer <michaelni@gmx.at>2011-11-04 01:07:44 +0100
commite6b225532933655d95266ce772b8a45b14aa27ec (patch)
treee316c2146735df2308f9df132729219e0da67ae8
parent7f7b2e89e270801ea5918afa1432d3bb32f6ebc7 (diff)
downloadffmpeg-e6b225532933655d95266ce772b8a45b14aa27ec.tar.gz
smacker: check buffer size before reading output size
(cherry picked from commit cf044f8bff0d28dbc34492f18b0d18b3ba8bad9d) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/smacker.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 30dbaa7dae..0c1aa16224 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -587,6 +587,11 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
int bits, stereo;
int pred[2] = {0, 0};
+ if (buf_size <= 4) {
+ av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
+ return AVERROR(EINVAL);
+ }
+
unp_size = AV_RL32(buf);
init_get_bits(&gb, buf + 4, (buf_size - 4) * 8);