diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-09-21 11:42:55 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-11 07:48:16 -0400 |
commit | cf044f8bff0d28dbc34492f18b0d18b3ba8bad9d (patch) | |
tree | 000b7aabf596e98165f70c595522be6ab8116c21 /libavcodec/smacker.c | |
parent | e190e453bd1e4d4b409ed3556b3a50d1087c15d7 (diff) | |
download | ffmpeg-cf044f8bff0d28dbc34492f18b0d18b3ba8bad9d.tar.gz |
smacker: check buffer size before reading output size
Diffstat (limited to 'libavcodec/smacker.c')
-rw-r--r-- | libavcodec/smacker.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index f3dec7f675..20ddc15915 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -586,6 +586,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); |