diff options
author | Philip Langdale <philipl@overt.org> | 2016-11-30 16:13:14 -0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-17 20:35:19 +0200 |
commit | 0a13449b2806893a8521fabad6b149c81d68dd2f (patch) | |
tree | bea283b123b153e2f0df47475e8475b14cf2a38e | |
parent | f1e6c03739d4b2cc014341a71cbeabe8e17cf8d5 (diff) | |
download | ffmpeg-0a13449b2806893a8521fabad6b149c81d68dd2f.tar.gz |
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
(cherry picked from commit 4e6d1c1f4ec83000a067ff14452b34c1f2d2a43a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/vdpau_hevc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vdpau_hevc.c b/libavcodec/vdpau_hevc.c index 3c1dc5f223..3223f5e2eb 100644 --- a/libavcodec/vdpau_hevc.c +++ b/libavcodec/vdpau_hevc.c @@ -245,7 +245,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"); |