Changeset 60346 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Apr 6, 2016 9:34:14 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 106420
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/sg.cpp
r59747 r60346 84 84 { 85 85 AssertPtr(pSgBuf); 86 Assert Ptr(paSegs);87 Assert(cSegs > 0);86 Assert( (cSegs > 0 && VALID_PTR(paSegs)) 87 || (!cSegs && !paSegs)); 88 88 Assert(cSegs < (~(unsigned)0 >> 1)); 89 89 … … 91 91 pSgBuf->cSegs = (unsigned)cSegs; 92 92 pSgBuf->idxSeg = 0; 93 pSgBuf->pvSegCur = paSegs[0].pvSeg; 94 pSgBuf->cbSegLeft = paSegs[0].cbSeg; 93 if (cSegs && paSegs) 94 { 95 pSgBuf->pvSegCur = paSegs[0].pvSeg; 96 pSgBuf->cbSegLeft = paSegs[0].cbSeg; 97 } 98 else 99 { 100 pSgBuf->pvSegCur = NULL; 101 pSgBuf->cbSegLeft = 0; 102 } 95 103 } 96 104 … … 100 108 AssertPtrReturnVoid(pSgBuf); 101 109 102 pSgBuf->idxSeg = 0; 103 pSgBuf->pvSegCur = pSgBuf->paSegs[0].pvSeg; 104 pSgBuf->cbSegLeft = pSgBuf->paSegs[0].cbSeg; 110 pSgBuf->idxSeg = 0; 111 if (pSgBuf->cSegs) 112 { 113 pSgBuf->pvSegCur = pSgBuf->paSegs[0].pvSeg; 114 pSgBuf->cbSegLeft = pSgBuf->paSegs[0].cbSeg; 115 } 116 else 117 { 118 pSgBuf->pvSegCur = NULL; 119 pSgBuf->cbSegLeft = 0; 120 } 105 121 } 106 122
Note:
See TracChangeset
for help on using the changeset viewer.