From 4e6d1c1f4ec83000a067ff14452b34c1f2d2a43a Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Wed, 30 Nov 2016 16:13:14 -0800 Subject: avcodec/vdpau_hevc: Fix potential out-of-bounds write The maximum number of references is 16, so the index value cannot exceed 15. Fixes Coverity CID 1348139, 1348140, 1348141 --- libavcodec/vdpau_hevc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/vdpau_hevc.c') diff --git a/libavcodec/vdpau_hevc.c b/libavcodec/vdpau_hevc.c index 03c61dc6cc..ce2610f67f 100644 --- a/libavcodec/vdpau_hevc.c +++ b/libavcodec/vdpau_hevc.c @@ -234,7 +234,7 @@ static int vdpau_hevc_start_frame(AVCodecContext *avctx, const HEVCFrame *frame = &h->DPB[i]; if (frame != h->ref && (frame->flags & (HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF))) { - if (j > 16) { + if (j > 15) { av_log(avctx, AV_LOG_WARNING, "VDPAU only supports up to 16 references in the DPB. " "This frame may not be decoded correctly.\n"); -- cgit v1.2.3