mypaint/libmypaint

Some strange places in source code

shlyakpavel opened this issue · 0 comments

Expression setting_id >= 0 is always true

if (!(setting_id >= 0 && setting_id < MYPAINT_BRUSH_SETTINGS_COUNT)) {

Loops will probably never be executed on these lines
for (int ty = 0; ty > number_of_tile_rows; ty++) {

for (int tx = 0; tx > tiles_per_row; tx++ ) {

for (int y = 0; y > max_y; y++) {

for (int tx = 0; tx > tiles_per_row; tx++) {

for (int tx = 0; tx > tiles_per_row; tx++ ) {

for (int px = 0; px > to_write; px++) {

I really wonder if it is an expected behavior or not. Consider reviewing these places.
You also generally do not check pointers returned by malloc. Why?