diff options
author | Kieran Kunhya <kierank@obe.tv> | 2014-06-16 01:44:15 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-06-26 09:14:57 +0400 |
commit | 9b60d9197970658e91daf4b586397f450de9af69 (patch) | |
tree | 086b8d16dd884267b3189ad4779ed602772c0894 /libavcodec | |
parent | 593d2326ef985cdffe413df629419938f7b07c4c (diff) |
hevc: Allow out of bound values for num_reorder_pics
This fixes decoding for a sample that cannot be shared
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/hevc_ps.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index 5e5d4a77e5..65f41b22df 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -375,9 +375,10 @@ int ff_hevc_decode_nal_vps(HEVCContext *s) goto err; } if (vps->vps_num_reorder_pics[i] > vps->vps_max_dec_pic_buffering[i] - 1) { - av_log(s->avctx, AV_LOG_ERROR, "vps_max_num_reorder_pics out of range: %d\n", + av_log(s->avctx, AV_LOG_WARNING, "vps_max_num_reorder_pics out of range: %d\n", vps->vps_num_reorder_pics[i]); - goto err; + if (s->avctx->err_recognition & AV_EF_EXPLODE) + goto err; } } @@ -760,10 +761,14 @@ int ff_hevc_decode_nal_sps(HEVCContext *s) goto err; } if (sps->temporal_layer[i].num_reorder_pics > sps->temporal_layer[i].max_dec_pic_buffering - 1) { - av_log(s->avctx, AV_LOG_ERROR, "sps_max_num_reorder_pics out of range: %d\n", + av_log(s->avctx, AV_LOG_WARNING, "sps_max_num_reorder_pics out of range: %d\n", sps->temporal_layer[i].num_reorder_pics); - ret = AVERROR_INVALIDDATA; - goto err; + if (s->avctx->err_recognition & AV_EF_EXPLODE || + sps->temporal_layer[i].num_reorder_pics > MAX_DPB_SIZE - 1) { + ret = AVERROR_INVALIDDATA; + goto err; + } + sps->temporal_layer[i].max_dec_pic_buffering = sps->temporal_layer[i].num_reorder_pics + 1; } } |