aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-05-26 22:13:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-08-11 13:21:14 +0200
commitc8c59e99295f9ef572b5d6f0fd9075bb2b79acbd (patch)
treeed3cd19fa2e08e4b8850e2c0a9b7f222fe144bb0 /libavcodec
parentb98125e5a52c2f96dc02380f8f7e3bb16752765b (diff)
downloadffmpeg-c8c59e99295f9ef572b5d6f0fd9075bb2b79acbd.tar.gz
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dxva2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
index 6eb66c02e4..75ca84d0fe 100644
--- a/libavcodec/dxva2.c
+++ b/libavcodec/dxva2.c
@@ -806,7 +806,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;
@@ -828,7 +828,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