mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-09 17:39:08 +00:00
avcodec/d3d12va_vp9: check size of frame bitstream against available buffer size
(cherry picked from commit a633df56a4)
This commit is contained in:
committed by
ffmpeg-devel
parent
ae0feeac8d
commit
3abec89a45
@@ -88,12 +88,18 @@ static int d3d12va_vp9_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
|
||||
|
||||
static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
|
||||
{
|
||||
D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
|
||||
const VP9SharedContext *h = avctx->priv_data;
|
||||
VP9DecodePictureContext *ctx_pic = h->frames[CUR_FRAME].hwaccel_picture_private;
|
||||
|
||||
void *mapped_data;
|
||||
D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args;
|
||||
|
||||
if (ctx_pic->slice.SliceBytesInBuffer > ctx->bitstream_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Input frame bitstream size exceeds internal buffer!\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (FAILED(ID3D12Resource_Map(buffer, 0, NULL, &mapped_data))) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Failed to map D3D12 Buffer resource!\n");
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
Reference in New Issue
Block a user