aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-13 01:31:15 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-21 20:43:38 +0200
commit885f501f7a1331bf24a310a16543dc550eabf729 (patch)
treefb17440b672736e5cee5e1d0a3afd605fdd96623 /libavcodec
parent00223d461bb78756033479e80c6a10a5570658bc (diff)
downloadffmpeg-885f501f7a1331bf24a310a16543dc550eabf729.tar.gz
avcodec/hevc_sei: Check num_sps_ids_minus1 value
Fixes CID1271794 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 93b0ee21a2f534f6d3b812686f3acde110e94f18) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/hevc_sei.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/hevc_sei.c b/libavcodec/hevc_sei.c
index 5bb5c9010a..13ebcd3ede 100644
--- a/libavcodec/hevc_sei.c
+++ b/libavcodec/hevc_sei.c
@@ -126,6 +126,11 @@ static int active_parameter_sets(HEVCContext *s)
get_bits(gb, 1); // num_sps_ids_minus1
num_sps_ids_minus1 = get_ue_golomb_long(gb); // num_sps_ids_minus1
+ if (num_sps_ids_minus1 < 0 || num_sps_ids_minus1 > 15) {
+ av_log(s->avctx, AV_LOG_ERROR, "num_sps_ids_minus1 %d invalid\n", num_sps_ids_minus1);
+ return AVERROR_INVALIDDATA;
+ }
+
active_seq_parameter_set_id = get_ue_golomb_long(gb);
if (active_seq_parameter_set_id >= MAX_SPS_COUNT) {
av_log(s->avctx, AV_LOG_ERROR, "active_parameter_set_id %d invalid\n", active_seq_parameter_set_id);