summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-15 16:48:31 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-15 16:48:31 +0200
commitd201becfc0d89c6a5dfe44e96f1044fbc2aadb70 (patch)
tree72801f402c1029de905a3f46fe49731e74457516 /libavcodec
parentc347f75d6bda24b6a3a81d343c0d84a73abc862c (diff)
avcodec/shorten: Check skip_bytes()
Fixes CID1210526 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/shorten.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index deae0fa1ce..413fb819dc 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -370,6 +370,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);
}