mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
avcodec/dxva2: Initialize dxva_size and check it
Related: CID1591878 Uninitialized scalar variable
Related: CID1591928 Uninitialized pointer read
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c8c59e9929)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -800,7 +800,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
|
||||
unsigned type, const void *data, unsigned size,
|
||||
unsigned mb_count)
|
||||
{
|
||||
void *dxva_data;
|
||||
void *dxva_data = NULL;
|
||||
unsigned dxva_size;
|
||||
int result;
|
||||
HRESULT hr = 0;
|
||||
@@ -822,7 +822,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
|
||||
type, (unsigned)hr);
|
||||
return -1;
|
||||
}
|
||||
if (size <= dxva_size) {
|
||||
if (dxva_data && size <= dxva_size) {
|
||||
memcpy(dxva_data, data, size);
|
||||
|
||||
#if CONFIG_D3D11VA
|
||||
|
||||
Reference in New Issue
Block a user