rendered paste bodyfrom buttons_shading.c case B_MTEXCOPY: if(ma && ma->mtex[(int)ma->texact] ) { mtex= ma->mtex[(int)ma->texact]; if(mtex->tex==0) { error("No texture available"); } else { //memcpy(&mtexcopybuf, ma->mtex[(int)ma->texact], sizeof(MTex)); //mtexcopied= 1; int orig = (int)ma->texact; int target = orig - 1; //printf("test\n"); //printf("%d \n", target); if (target > -1) { //copy tex memcpy(&mtexcopybuf, ma->mtex[orig], sizeof(MTex)); //copy from target to original //if(ma->mtex[orig]==0) // ma->mtex[orig] = MEM_mallocN(sizeof(MTex), "mtex"); memcpy(ma->mtex[orig], ma->mtex[target], sizeof(MTex)); //segfaults here! //paste copied tex to target //if(ma->mtex[target]==0) // ma->mtex[target] = MEM_mallocN(sizeof(MTex), "mtex"); //memcpy(ma->mtex[target], &mtexcopybuf, sizeof(MTex)); //paste target tex to original channel //if(ma->mtex[orig]==0) // ma->mtex[orig] = MEM_mallocN(sizeof(MTex), "mtex"); //memcpy(ma->mtex[orig], &mtexcopybuf2, sizeof(MTex)); /* id_us_plus((ID *)mtexcopybuf.tex); BIF_undo_push("Move texture up"); BIF_preview_changed(ID_MA); scrarea_queue_winredraw(curarea); */ } } } break;