diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-15 04:30:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-15 04:45:42 +0100 |
commit | ab296c7a9fe590860dc95ba97e9cbb9dde798f20 (patch) | |
tree | d04405d089085a0144d6522f772c2d646a327f0a /libavcodec/hevc_ps.c | |
parent | 8bfa5f7fab3dfc6ca163b74499ef8ab09a1cfea6 (diff) | |
download | ffmpeg-ab296c7a9fe590860dc95ba97e9cbb9dde798f20.tar.gz |
avcodec/hevc_ps: Override max_dec_pic_buffering when its inconsistent with num_reorder_pics
Fixes Ticket3304
Alternatively max_dec_pic_buffering could be removed completely as its not used.
Based on a patch by Jose Santiago <santiago@haivision.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc_ps.c')
-rw-r--r-- | libavcodec/hevc_ps.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index 1684d77672..24968cce03 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -763,8 +763,11 @@ int ff_hevc_decode_nal_sps(HEVCContext *s) 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", sps->temporal_layer[i].num_reorder_pics); - ret = AVERROR_INVALIDDATA; - goto err; + if (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; } } |