diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-06 05:51:20 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-06 07:30:04 +0400 |
commit | d66bab0a69ac1860e78dd951ad8db1a507e75642 (patch) | |
tree | 49fe7182d40785e0e0c119ca7f3ddb3cf605fa60 /libavcodec/hevc_ps.c | |
parent | 4816d63fb7f69687af8a9b21858612a53c24d025 (diff) |
avcodec/hevc_ps: check that VPS referenced from SPS exists
This matches how its done for SPS/PPS.
An alternative to this is to check it when its used.
Fixes null pointer dereference
Fixes: signal_sigsegv_e30a43_1437_CIP_A_Panasonic_3.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc_ps.c')
-rw-r--r-- | libavcodec/hevc_ps.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index 69500279be..1684d77672 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -635,6 +635,12 @@ int ff_hevc_decode_nal_sps(HEVCContext *s) goto err; } + if (!s->vps_list[sps->vps_id]) { + av_log(s->avctx, AV_LOG_ERROR, "VPS does not exist \n"); + ret = AVERROR_INVALIDDATA; + goto err; + } + sps->max_sub_layers = get_bits(gb, 3) + 1; if (sps->max_sub_layers > MAX_SUB_LAYERS) { av_log(s->avctx, AV_LOG_ERROR, "sps_max_sub_layers out of range: %d\n", |