Changeset 78788 in vbox for trunk/src/VBox/GuestHost/OpenGL/include/cr_unpack.h
- Timestamp:
- May 27, 2019 7:06:10 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_unpack.h
r78375 r78788 95 95 { \ 96 96 (a_pState)->rcUnpack = VERR_BUFFER_OVERFLOW; \ 97 AssertFailed(); \ 97 98 return; \ 98 99 } \ … … 107 108 { \ 108 109 (a_pState)->rcUnpack = VERR_BUFFER_OVERFLOW; \ 110 AssertFailed(); \ 109 111 return; \ 110 112 } \ … … 129 131 { 130 132 pState->rcUnpack = VERR_BUFFER_OVERFLOW; 133 AssertFailed(); 131 134 return ~(size_t)0; 132 135 } … … 168 171 do \ 169 172 { \ 170 if (RT_UNLIKELY((a_pState)->cbUnpackDataLeft < (size_t)(delta))) \ 173 size_t a_cbAdv = (delta); \ 174 if (RT_UNLIKELY((a_pState)->cbUnpackDataLeft < a_cbAdv)) \ 171 175 { \ 172 176 (a_pState)->rcUnpack = VERR_BUFFER_OVERFLOW; \ 177 AssertFailed(); \ 173 178 return; \ 174 179 } \ 175 (a_pState)->pbUnpackData += (delta); \176 (a_pState)->cbUnpackDataLeft -= (delta); \180 (a_pState)->pbUnpackData += a_cbAdv; \ 181 (a_pState)->cbUnpackDataLeft -= a_cbAdv; \ 177 182 } while(0) 178 183 … … 185 190 { \ 186 191 CRDBGPTR_CHECKZ((a_pState)->pReturnPtr); \ 187 if ( !DATA_POINTER_CHECK(a_pState, offset + sizeof(*(a_pState)->pReturnPtr))) \192 if (offset + sizeof(*(a_pState)->pReturnPtr) > (a_pState)->cbUnpackDataLeft) \ 188 193 { \ 189 194 crError("%s: SET_RETURN_PTR(%u) offset out of bounds\n", __FUNCTION__, offset); \ … … 197 202 { \ 198 203 CRDBGPTR_CHECKZ((a_pState)->pWritebackPtr); \ 199 if ( !DATA_POINTER_CHECK(a_pState, offset + sizeof(*(a_pState)->pWritebackPtr))) \200 { \ 201 crError("%s: SET_ RETURN_PTR(%u) offset out of bounds\n", __FUNCTION__, offset); \204 if (offset + sizeof(*(a_pState)->pWritebackPtr) > (a_pState)->cbUnpackDataLeft) \ 205 { \ 206 crError("%s: SET_WRITEBACK_PTR(%u) offset out of bounds\n", __FUNCTION__, offset); \ 202 207 return; \ 203 208 } \
Note:
See TracChangeset
for help on using the changeset viewer.