diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-15 17:48:31 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-10 03:13:11 +0300 |
commit | a7c8dc67e773d8591cd29cbfb8b4ab586c3ba160 (patch) | |
tree | 7f1d327157e079e6f57dedda204599f64055f579 | |
parent | 0888e7110e7ac23cb884d5dcdebe9090f02548ea (diff) |
avcodec/shorten: Check skip_bytes()
Fixes CID1210526
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d201becfc0d89c6a5dfe44e96f1044fbc2aadb70)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/shorten.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 08ea2178a4..a512759fd4 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -366,6 +366,11 @@ static int read_header(ShortenContext *s) s->nmean = get_uint(s, 0); skip_bytes = get_uint(s, NSKIPSIZE); + if ((unsigned)skip_bytes > get_bits_left(&s->gb)/8) { + av_log(s->avctx, AV_LOG_ERROR, "invalid skip_bytes: %d\n", skip_bytes); + return AVERROR_INVALIDDATA; + } + for (i = 0; i < skip_bytes; i++) skip_bits(&s->gb, 8); } |