History

avcodec/dxva2: Initialize dxva_size and check it

Related: CID1591878 Uninitialized scalar variable Related: CID1591928 Uninitialized pointer read

Michael Niedermayer committed 2 years ago

Commit c8c59e91 parent b98125e1 file · +2 −2Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/dxva2.c+2−2
@@ -806,7 +806,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx, · 805 unmodified lines
806 unsigned type, const void *data, unsigned size,806 unsigned type, const void *data, unsigned size,
807 unsigned mb_count)807 unsigned mb_count)
808{808{
809 void *dxva_data;809 void *dxva_data = NULL;
810 unsigned dxva_size;810 unsigned dxva_size;
811 int result;811 int result;
812 HRESULT hr = 0;812 HRESULT hr = 0;
@@ -828,7 +828,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx, · 15 unmodified lines
828 type, (unsigned)hr);828 type, (unsigned)hr);
829 return -1;829 return -1;
830 }830 }
831 if (size <= dxva_size) {831 if (dxva_data && size <= dxva_size) {
832 memcpy(dxva_data, data, size);832 memcpy(dxva_data, data, size);
833 833
834#if CONFIG_D3D11VA834#if CONFIG_D3D11VA

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t