diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-13 13:13:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-13 14:26:17 +0200 |
commit | 3e9d5e16ad9799f6b6faae4f21120d23146b84c9 (patch) | |
tree | 0dcbbc57ca52fe26a30e2f5fc21fb5282ca6c28f | |
parent | 6d787aea96d4bfa441d1c3251dfaff7ef2bcb74b (diff) | |
download | ffmpeg-3e9d5e16ad9799f6b6faae4f21120d23146b84c9.tar.gz |
avcodec/hevc: Check offset_len
Fixes CID1239099 part 1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/hevc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 554e60fecb..dc7cabb6d5 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -712,6 +712,13 @@ static int hls_slice_header(HEVCContext *s) int offset_len = get_ue_golomb_long(gb) + 1; int segments = offset_len >> 4; int rest = (offset_len & 15); + + if (offset_len < 1 || offset_len > 32) { + sh->num_entry_point_offsets = 0; + av_log(s->avctx, AV_LOG_ERROR, "offset_len %d is invalid\n", offset_len); + return AVERROR_INVALIDDATA; + } + av_freep(&sh->entry_point_offset); av_freep(&sh->offset); av_freep(&sh->size); |