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
806806 unsigned type, const void *data, unsigned size,
807807 unsigned mb_count)
808808 {
809− void *dxva_data;
809+ void *dxva_data = NULL;
810810 unsigned dxva_size;
811811 int result;
812812 HRESULT hr = 0;
@@ -828,7 +828,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx, · 15 unmodified lines
828828 type, (unsigned)hr);
829829 return -1;
830830 }
831− if (size <= dxva_size) {
831+ if (dxva_data && size <= dxva_size) {
832832 memcpy(dxva_data, data, size);
833833
834834 #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