mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-19 05:49:09 +02:00
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>
This commit is contained in:
parent
95594b9815
commit
9c7730417d
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user