Commit 35c20e0
committed
Set MP4Array size only after successful alloc.
m_numElements was set before checking newSize and trying MP4Realloc. In case the size check or MP4Realloc threw an exception, deallocators would iterate over the never allocated new number of elements and attempt calling delete on them.
Also check size of ftyp atom to avoid the uint32_t underflow that caused the bad alloc request.
Addresses: https://nvd.nist.gov/vuln/detail/CVE-2018-172361 parent b8d0528 commit 35c20e0
2 files changed
+10
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
103 | 108 | | |
104 | 109 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
0 commit comments