PVS43: two if with same condition in BBitmap::SetBits

This commit is contained in:
Adrien Destugues 2015-04-30 18:40:25 +02:00
parent 744ab983f3
commit 487d015ab7
2 changed files with 13 additions and 8 deletions

View File

@ -216,9 +216,11 @@ get_raw_bytes_per_row(color_space colorSpace, int32 width)
case B_YCbCr420: case B_YUV420:
bpr = (width + 3) / 4 * 6;
break;
case B_YUV9:
bpr = (width + 15) / 16 * 18;
// unsupported
case B_NO_COLOR_SPACE:
case B_YUV9: case B_YUV12:
case B_YUV12:
break;
}
return bpr;
@ -1761,10 +1763,10 @@ BBitmap::SetBits(const void *data, int32 length, int32 offset,
// ignore source data row padding.
} else if (colorSpace == B_CMAP8 && fColorSpace != B_CMAP8)
inBPR = width;
}
// call the sane method, which does the actual work
if (error == B_OK)
// call the sane method, which does the actual work
error = ImportBits(data, length, inBPR, offset, colorSpace);
}
}

View File

@ -124,9 +124,12 @@ get_raw_bytes_per_row(color_space colorSpace, int32 width)
case B_YCbCr420: case B_YUV420:
bpr = (width + 3) / 4 * 6;
break;
case B_YUV9:
bpr = (width + 15) / 16 * 18;
break;
// unsupported
case B_NO_COLOR_SPACE:
case B_YUV9: case B_YUV12:
case B_YUV12:
break;
}
return bpr;
@ -644,10 +647,10 @@ BBitmap::SetBits(const void* data, int32 length, int32 offset,
// ignore source data row padding.
inBPR = width;
}
}
// call the sane method, which does the actual work
if (error == B_OK)
// call the sane method, which does the actual work
error = ImportBits(data, length, inBPR, offset, colorSpace);
}
}