Commit 979cf77d authored by Linlin Yan's avatar Linlin Yan
Browse files

Fix a crash bug (when end == -1).

parent 47bdc326
......@@ -124,7 +124,7 @@ void BedGenomeCoverage::AddCoverage(int start, int end) {
// make sure the coordinates fit within the chrom
if (start < _currChromSize)
_currChromCoverage[start].starts++;
if (end < _currChromSize)
if (end >= 0 && end < _currChromSize)
_currChromCoverage[end].ends++;
else
_currChromCoverage[_currChromSize-1].ends++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment