diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-12 05:07:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-12 07:46:07 +0200 |
commit | 5d88e40093ffc9ed3d643516b4502edfe12d7756 (patch) | |
tree | da36aec473c0e2dac7a9cf361fc1399cf638cba4 /libavcodec/hevc.c | |
parent | c79acacd2ef222fbc644bf7d832d85c626c10d0d (diff) | |
download | ffmpeg-streaming-5d88e40093ffc9ed3d643516b4502edfe12d7756.zip ffmpeg-streaming-5d88e40093ffc9ed3d643516b4502edfe12d7756.tar.gz |
avcodec/hevc: check slice_header_extension data length
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 8ae8fc7..a64c627 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -708,6 +708,10 @@ static int hls_slice_header(HEVCContext *s) if (s->pps->slice_header_extension_present_flag) { unsigned int length = get_ue_golomb_long(gb); + if (length*8LL > get_bits_left(gb)) { + av_log(s->avctx, AV_LOG_ERROR, "too many slice_header_extension_data_bytes\n"); + return AVERROR_INVALIDDATA; + } for (i = 0; i < length; i++) skip_bits(gb, 8); // slice_header_extension_data_byte } |